Page 12 - Modular_V2.0_C++_Flikpbook
P. 12

Step 4   Click on OK button. The file will be saved with the given name. The file name appears
                            on top-center of the file in place of NONAME00.CPP.

                  Compiling a Program

                  After saving a program, you need to compile the program to check whether it contains any
                  warning or error. To compile a program, perform the following steps:
                  Step 1    Click on Compile menu from the menu bar.

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

                  If the program has errors or warnings,
                                                                Compiling a program            Compiling screen
                  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();
                   10
                          Touchpad MODULAR (Ver. 2.0)
   7   8   9   10   11   12   13   14   15   16   17