The usage of mian function in C++ Foundation
This article for everyone to show the c++ basis of the use of mian function, concise and easy to understand, absolutely can make your eyes shine, through the detailed introduction of this article I hope you can gain something.
1. Start with the main function
int main()
{
return 0;
}
The operating system executes the program by calling the main function, which executes the statements that compose itself and returns a value. A return of 0 indicates that the program has completed successfully. (Non-zero return values have operating system-defined meanings)
2. input and output
Input and output functionality (IO) is provided by the standard library, and the iostream library is based on two types named istream and ostream.
Standard input (istream) cin
standard output (ostream) cout cerr (standard error) log (general information)
#include //preprocessing hints (using iostream library)
int main()
{
std::cout > v2; //std is namespace
:: Yes Scope Operator>> Yes Input Operator
std::cout