From charlesreid1

No edit summary
Line 1: Line 1:
= C++ =
= C++ =


HelloWorld.cc:
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
#include <iostream>
#include <iostream>
Line 8: Line 9:
     std::cout << "Hello, world! This is C++.\n";
     std::cout << "Hello, world! This is C++.\n";
}
}
</syntaxhighlight>
To run it:
<syntaxhighlight lang="bash">
$ g++ HelloWorld.cc -o hello.x
$ ./hello.x
</syntaxhighlight>
</syntaxhighlight>

Revision as of 06:46, 5 October 2010

C++

HelloWorld.cc:

#include <iostream>
 
int main()
{
     std::cout << "Hello, world! This is C++.\n";
}

To run it:

$ g++ HelloWorld.cc -o hello.x
$ ./hello.x