View Single Post
Old Sep 25th, 2006, 8:38 PM   #4
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 6 bl00dninja is on a distinguished road
#include <iostream>
// copy that library into your code so you can cin & cout 
//(pastes the whole thing into your code)
using namespace std;
//so you don't have to qualify everything in iostream with
//the namespace

int main()//there is only 1 main and it returns an int
//0 for success, something else for failure
//body of main
{
cout<<"hello n00b"<<endl;
//we have stated that the namespace is std, so we don't have to do THIS:
//std::cout<<"hello n00b"<<std::endl;
return 0;
//main must return an int, 0 says no problems, you can insert your own #'s
//if main failed to allocate memory then you can return 1, or 2,or 87267659265

/*when you see an app that says "returned 24875287, memory fault", that's what we're talking about here, error codes let the programmer define bad situations so they can fix them */
}

good luck!
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote