Skip to content

Commit

Permalink
Working on part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Swain committed Apr 8, 2012
1 parent 9b54a03 commit 40a1504
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion part1-intmain.md
@@ -1,3 +1,21 @@
# Part 1: `int main`

In C and C++ programs, the
The entry point for C and C++ programs is a function called `main`. The hello world program in C++ looks like this:

```c++
#include <iostream>

int main(int argc, char** argv)
{
std::cout << "Hello, world." << std::endl;

return 0;
}
```
You can find the `helloworld.cpp` file in this directory. Compile and run it from the command line like this:
g++ helloworld.cpp -o helloworld
./helloworld

0 comments on commit 40a1504

Please sign in to comment.