How to compile and execute c and c++ programs in linux
Hai
How to compile and execute c and c++ programs in linux |
You compile C programs with gcc:
$ gcc program.c For C++ programs: $ g++ program.cc The executables are usually named a.out, so you run them with $ ./a.out You can change the name of the executable with the -o option: $ g++ test.cc -otest This will give you an executable named test, which you can run in the same way as above. Read the man pages for gcc and g++ for more options you can use with them. |
All times are GMT -5. The time now is 03:03 AM. |