Tutorials on C++ 😁😁

Why do we learn C++?

There are three main reasons for us to learn C++:

Popularity :
  • Lots of code is still returned in C++.
  • Programming language popularity indexes.
  • Active Community in Github, Stack Overflow and many other platforms.
Relevant :
  • Windows, Linux and Gaming Engines more ...
  • Amazon, Google, and many other Multinational Companies use this language.
Powerful :
  • Fast, Flexible, Scalable and Portable.
  • Procedural and Object-Oriented Programming Language.
Good Career Opportunities :
  • C++ skills are always in demand.
  • C++ == Salary++.
How to it Works?

When you write a source code file in C++, you include header files with extensions .h, .hxx, or .hpp, and sometimes with no extensions. You use the directive #include to mark a header file. The source file usually has the extension .cc, .cxx or .cpp.

First Step (Preprocessing) :

  • In this process first, the compiler is sent to the preprocessor(simply a directive that starts with #). So #include, #define is some preprocessors with which the compiler interacts.

Second Step (Compilation and Assembly) :

  • The next stage of compilation in C++ is very similar to what happens in C. The compiler takes each output from the preprocessor and creates an object file from it in two steps.
  • First, it converts the pure C++ code without any # directives into assembly code. Assembly code is a binary code that we can read.

Third Step (Assembly) :

  • Next, the assembler converts the assembly code into bit code, line by line. The output of this stage is a binary file in format COFF, ELF, a.out and similar. You can always stop compiling at this point, which is a useful feature since you can compile each code separately. You can put every object file that you get out of this process into archives called static libraries. Later, when you want to use these object files, you can simply pull them out of your libraries without having to recompile all the source files if you only change one file.

Fourth Step (Linking) :

  • You would not get the result without linking the object files that the assembler produced in the previous stage. It is the job of the linker to produce either a dynamic (or shared) library or an executable file.

Conclusion : 

C++ is a general-purpose, Object-Oriented programming language that was designed by Bjarne Stroustrup in 1979 to be an extension of the C language. It has the features of imperative, object-oriented as well as generic programming models. C++ also has some additional facilities for those in C such as classes, inheritance, default function argument, etc. 
  • It has abundant Library support.
  • It has a large Community.
  • Many Databases are written in C++ such as MongoDB, MySQL, etc.
  • All the Operating systems such as Windows, Linux, Android, Ubuntu, and IOS are written in C++ && C.
  • C++ is used to write many Compilers, Web Browsers.
  • It is also used in Graphics due to its high speed.
  • C++ is Portable.

Comments

Popular posts from this blog

Basic things You need to Know in C++😁

Arrays and Vectors ❤️