Skip to main content

Compilation Process of a C++ Program




Compiling a C++ program involves a number of steps (most of which are
transparent to the user):

· First, the C++ preprocessor goes over the program text and carries out theinstructions specified by the preprocessor directives (e.g., #include). The result is a modified program text which no longer contains any directives.

· Then, the C++ compiler translates the program code. The compiler may be a true C++ compiler which generates native (assembly or machine) code, or just a translator which translates the code into C. In the latter case, the resulting C code is then passed through a C compiler to produce native object code. In either case, the outcome may be incomplete due to the program referring to library routines which are not defined as a part of the program. For example, Listing 1.1 refers to the << operator which is actually defined in a separate IO library.


· Finally, the linker completes the object code by linking it with the object code of any library modules that the program may have referred to. The final result is an executable file.


In the following  Figure,  illustrates the above steps for both a C++ translator and a C++ native compiler. In practice all these steps are usually invoked by a single command (e.g. CC) and the user will not even see the intermediate files generated.


Comments

  1. ok thanks for this post it's quite informative and I have learned new things.
    kajal hot

    ReplyDelete
  2. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    Java Training in Chennai | J2EE Training in Chennai | Advanced Java Training in Chennai | Core Java Training in Chennai | Java Training institute in Chennai

    ReplyDelete
  3. Great Share!!!The parts of information about JAVA are much helpful for me...I would like to share this amazing Articles with my colleague circle...Keep posting like this more and more
    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

    ReplyDelete
  4. I find this blog to be very interesting and very resourceful. I would say that your blogs are really interesting and informative for me and this article explained everything in detail.
    Java Training in Chennai

    Java Training in Velachery

    Java Training in Tambaram

    Java Training in Porur

    Java Training in Omr

    Java Training in Annanagar

    ReplyDelete
  5. Thanks for this Amazing blog , keep sharing this type of content with us and keep updating us. Apart from this if someone is looking for the best training institute in delhi for C++ traning or course in delhi , i would like to recommened High Technologies Solutions in delhi is the best training institute ,for more details call us on 9311002620
    visit website for more details
    Best Training Institute for c++ Training Course in Delhi, NCR


    ReplyDelete
  6. Thank you so much for this amazing blog. Keep sharing this type of content with us. If anyone wants to learn C/C++ in Delhi, I will recommend High Technologies Solutions training institute.
    For any further information please call +919311002620 or you can visit website https://htsindia.com/Courses/modular-courses/c-plus-plus-training-course

    ReplyDelete

Post a Comment

Give your valuable Comment...

Popular posts from this blog

Object-Oriented Programming and JAVA Programming Language

  Object-Oriented Programming and:   Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, messaging, modularity, olymorphism, and inheritance. Many modern programming languages now support OOP, at least as an option. JAVA Programming Language: Object-oriented programming is at the core of Java. In fact, all Java programs are object-oriented, this isn’t an option the way that it is in C++, for example. OOP is so integral to Java that you must understand its basic principles before you can write even simple Java programs. Therefore, this chapter begins with a discussion of the theoretical aspects of OOP.

Read or input form user in Java using BufferedReader

 BufferedReader use to read text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.The buffer size may be specified, or the default size may be used. The default is large enough for most purposes. In Java  BufferedReader is a efficient method to read an input. Here given a short example to read a string from user and print it: package palindrome; import java.io.BufferedReader; import java.io.InputStreamReader; public class  inputExample   {     public static void main(String[] args) throws Exception {    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));     String s = new String();       s =br.readLine();     System.out.println(s);     } }