C++ Program

C++ compilation

Generally speaking compiling is a process of converting human understandable code into machine code. In reality this process is language specific. C++ compilation interacts with the operating systems rather than with processor itself. For example assembly language works mostly with processor. One of the main advantages of C++ is possibility to use assembly language. Using assembly language means writing the fastest and shortest code possible. It is either fastest or shortest in fact.

Here is a short description. Humans write code which they can understand without much trouble (in most cases). And then in one go this code is converted into a program. This conversion is called compilation. It’s done by compilers. Compiler is a program which converts human understandable code into a program.

In fact only compiled programming languages require compilation. C++ is a compiled language. All other non compiled languages are called interpreted languages. For example PHP programming language doesn’t need compiler and compilation at all.

Another peculiarity of C++ programming language is it is strongly typed language. This fact creates what’s called forward declaration. The result is using header files with .h extension. C++ header files are a very interesting subject. One can successfully create programs in C++ without almost any understanding of header files. This subject is not the first priority for programming beginners.

And eventually we have:

a code, written by a human, human understandable code

a compiler, a program, which converts the human code into

a computer understandable code, machine understandable code

which is called a working computer program in most cases

The C++ code is usually stored in several .cpp and .h files. But there is another file which tells compiler exactly what to do. It’s called a make file. Make files use their own make file language. Again, this is not the first priority for C++ beginner programming. One can successfully write programs without any idea about existence of make files if he uses IDE.

Here is a C++ Hello World compiling example. One can learn it once and then compile any other project in the same manner.

That’s the main pleasure for C++ programming beginner. He doesn’t need to know about all those intricacies of compilation process if he uses IDE, Integrated Development Environment. He just writes program code, clicks a button and in few seconds we get a working program which we can use then to satisfy all our needs. (In most cases he actually gets error messages, letters of happiness from God about how stupid he is. Programming like any other work is a trial of stamina.)

Other people prefer to go deep into compilation process, to know every detail of this. Still others prefer to not use IDEs at all and do everything by hand. Not a very good way for a beginner.

Leave a Reply

Your email address will not be published. Required fields are marked *