Professional Documents
Culture Documents
I Hear and I Forget
I Hear and I Forget
myprogram.c
#include <iostream> using namespace std;
int main() { cout<<Hello\n; return 0; }
It is human-readable
myprogram.o
machine-readable
Compiler
Preprocessor
Linker
#include <iostream> using namaespace std; int main( ) { cout <<"Welcome to C++"; return 0; }
iostream is the name of library that contains definition of routines that handle input and output.
#include <iostream> using namespace std; int main( ) { cout <<"Welcome to C++"; return 0; //this is a simple program }//end of main block
Omitting a semicolon is a syntax error. Other errors could be: mis-typing a keyword omitting braces or parenthesis forgetting << operator in cout Compiler can catch such errors.