COMPILING AND RUNNING A C++ PROGRAM


You will be doing programming development on a Windows environment using Microsoft Visual C++.NET. The development process involves creating programs using a built-in editor, compiling, linking and running them all within an Interactive Development Environment (IDE). You will learn about that in your first laboratory this week. Please take your laptop computer to RH206 if you currently do not have Microsoft Visual C++.NET installed.

On a UNIX machine like UTOPIA, you should use an editor such as pico to create or edit your program. It should be saved with a file name extension of .cpp. For example for your first homework you should call it hw01.cpp.

To compile (and link) it, use the command:

g++ hw1.cpp

If your program compiles without an error, you will simply get the UNIX prompt back with no other message. You'll find that a file called a.out has been created.

To run the compiled program, simple type

a.out

The resulting output, if any, will then appears on the screen.