Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 131 - CoreGPT(Podar)_Flipbook_C8
P. 131

    Step 2   Select the Compile option press Alt + F9 on the keyboard. A compiling popup box will
                              appear, showing the progress of the compilation.

                                              Compiling a program            Compiling screen

                     If the program has errors or warnings, their count will be displayed in the popup. If there are no

                     errors, it will show "Success" and the program is ready to run.
                              Tech Funda

                               Shortcut key to save a file is F2.
                               Shortcut key to compile a program is Alt + F9.

                     Running a Program

                     Once your program is compiled successfully, you need to run it to see the output. Follow the
                     given steps to run a program:

                     Step 1   Click on the Run menu from the top menu bar.
                     Step 2   Select the Run option or press Ctrl + F9 on the keyboard.

                     Sometimes, after running the program, the output disappears
                     quickly  because  the  compiler  does  not  pause  the  output
                     window. To see the output properly:
                                                                                                Running a program
                            Click on Window   Output from the menu bar.
                     To open the output window automatically, you need to use the following lines of code:
                        a.   #include<conio.h>: This line comes under the #include<iostream.h>.

                        b.   getch(): This line comes at the end of the program before the ending brace ( } ).
                     For example:

                     #include<iostream.h>
                     #include<conio.h>
                     void main()
                     {

                         clrscr();
                         cout<< "Hello World";
                         getch();

                     }

                                                                                               Introduction to C++      129

| 126 127 128 129 130 131 132 133 134 135 136 |