CyberiaPC.com Main Page




Learning C++

{4} Compiling and Running

Now that you have completed your program you'll need to compile it.  Compiling will tell you if there are any errors in your code.  If there are none, then an EXE is created for you.  Either click Ctrl+F5 or click on the build button.  VC++ will start compiling.  You can see the progress in the area on the bottom of your screen.  When VC++ finishes compiling your program, you should get:

     --------------------Configuration: program_name - Win32 Debug--------------------
     Compiling...
     Main.cpp
     Linking...
     
     program_name.exe - 0 error(s), 0 warning(s)

If you get an error or a warning, then scroll up to the line where the error has occurred (All lines containing errors are shown in the same area at the bottom) and double click on it.  You will be transferred to the line in question where you can correct the mistake.  The type of error is also shown at the very bottom of your screen.

After your code is compiled successfully, click on the Execute button to run your program from within the VC++ environment.  Enter values as prompted as though you were the user.  If everything goes well then you are ready to take your EXE file and run it on any PC you like.

{Go To Step 5}