I don't know much C++ yet. But here's my first program! I called it "firstprog.cpp".
#include <stdio.h>
int main()
{
int i;
for(i=0; i<10; i++)
{
puts("Hello, world!n");
}
return 0;
}
To make the program run, go to the directory where you saved it. Type:
g++ firstprog.cpp -o firstprog
This will compile your program into an executable called "firstprog".
Then run it with:
./firstprog
Here's a screen-shot:
