To share this page click on the buttons below;
Introduction to C Language
C language is one the most widely used programming language. C was designed and developed by Brian Kernighan e Dennis Ritchie with the purpose to use it as the programming language to make the Unix Operating System. C is everywhere: all important Operating Systems (Linux, Unix, Windows) are written in C, but also graphical libraries, windows managers, databases and even some high level programming languages are written in C.
The most important strength of C is the ability to deal with hardware: although C can be used to write whatever software, it is quite a low level language, able to easily map memory and CPU registers. With C you have the complete control of your code and you can really carve the behavior and the performance of your programs.
C is a typed language. Typed means that the variables used by the programming language can contain only a certain type of data and you need to specify which kind of data each variable is allowed to manage.
C is a compiled language. Compiled means that the source files your program is composed of (just a set of text files organized in a certain way) are translated into a format that is understandable directly by the microprocessor (the executable). You can in fact write C programs that run on the bare metal of a microprocessor, but a C program can also run within an Operating System: in this case the compiler embeds into the executable additional information needed by the Operating System to run the program (one of the purpose of an Operating System is to provide a common abstraction layer of hardware so that application programs can run on different hardware).
C is powerful, but it has some weakness. One of them is somehow related to its strength: being low level and hardware oriented means that it does not implement natively some common high level constructions (which are available in high level programming language like Python or Lua).
The second weakness of C is the portability. C is not easily portable. Let say that you wrote an application in C for Linux: your executable runs perfectly on that operating system and does all it has to do, well your executable won't run on Windows. To get an executable that runs also on Windows you need at least to compile your program for that Operating System: but this usually is not enough. To get an executable that runs both on Windows and Linux you need to be careful when you design you program and use only libraries and data structure that are available on both systems. In the same way a C program compiled for an Intel microprocessor won't run on a ARM microprocessor (in this case the problems are related to the differences of the underlying hardware). Portability is a big deal and it forces the programmer to maintain different system of build and to be aware of all the differences between different hardwares and operating systems.
To share this page click on the buttons below;