Tuesday, July 28, 2009

Who can give me a simple meaning of the following words used in C++?

Int Main()





#include %26lt;iostream%26gt;





using namespace std;





return 0;





Can someone please give me the meanings of these words used in C++ that a beginner programmer can understand. I'm 14 and I'm trying to learn C++ for future purposes.





Thanks for helping.

Who can give me a simple meaning of the following words used in C++?
* Int Main()





You probably mean int main(). C++ is case-sensitive so the difference is imporant. You are declaring the main function here. The main function is where your program will begin execution.





* #include %26lt;iostream%26gt;





You are telling the compiler that you will be using the iostream library. This is where a lot of the functions are that you will use to read and write to the screen (among many other things)





* using namespace std;





Complicated. Namespaces are families of definitions. The std namespace is where many of the standard library items are defined. Here, you're telling the compiler that you will be using this namespace frequently and treat functions in the std namespace as though they were defined locally.





* return 0





The return statement exits a function and "returns" a value to the calling function. return 0 sends the value zero back to whoever called your function. main() is called by the system, so return 0 at the end of main() sends zero back to the system (which, for the most part, ignores it).





Good luck.

online survey

No comments:

Post a Comment