Get the App
SLTechnology News&Howtos  ›  Development  › 

The usage of mian function in C++ Foundation

Shulou Source: shulou.com Published: 2022-06-03 05:56:40 11月17日 Update

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

Tags: Function output standard input foundation operating system system cantilever content skill operator knowledge program concise successful concise function information function meaning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Huawei MariaDB Xiaomi macOS