2006/01/04

[Mac] C++ Programming

Do C++ Programming in a Mac machine

Here is a simple code (Hello World): Save file as test.cpp
<br>#include <iostream><iostream.h><iostream><br>using namespace std;<br>int main()<br>{<br><span style="margin-left: 20px;">cout &lt;&lt; "Hello World!\n\n";</span><br><span style="margin-left: 20px;">return 0;</span><br>}</iostream></iostream.h>

Compile:
(make output file named test.out)
g++ test.cpp -o test.out<br>
Excute output:
./test.out