Powered by Blogger.

Compiling your first C++ program with ubuntu

Friday, July 17, 2009

Compiling your first C++ program
If you want to run c++ program follow this procedure
g++ is the compiler that you must use.
you should use a .cpp file extension rather than a .c one
You need to create a file
sudo gedit first.cpp
add the following lines save and exit the file

Run your C++ Program using the following command
g++ first.cpp -o test
./test
Output should show as follows
Hello World!

No comments: