http://www.cplusplus.com/doc/tutorial/program_structure/
You can test it here first - http://cpp.sh/
As for the error, the build failed to compile,
[shcode=cpp]
#include <iostream>
using namespace std;
int main()
{
int a;
a = 1;
cout << a;
}
[/shcode]