All pastes #836009 Raw Edit

Untitled

public text v1 · immutable
#836009 ·published 2007-12-29 04:20 UTC
rendered paste body
#include <iostream>     //includes the header file iostream

using namespace std;    //tells the compiler to use the std library

int main()              // declares the function main which returns an int
{                       //tells the program to take everything between here and the close as main
cout<<"Hello World!\n"; // displays Hello world on the console


cin.get();              // stalls the program until a key is pressed
return 0;               // returns 0 (a 1 would indicate an error
}                       // closes main

cpunches@shampoo:~/Desktop$ gcc -o hello hello.c
hello.c:5:60: error: iostream: No such file or directory
hello.c:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'
hello.c: In function 'main':
hello.c:11: error: 'cout' undeclared (first use in this function)
hello.c:11: error: (Each undeclared identifier is reported only once
hello.c:11: error: for each function it appears in.)
hello.c:14: error: 'cin' undeclared (first use in this function)