[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppExit
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppExit
(C++) std::exit
Function to end the program.int main(int argc, char* argv) { if (argc==1) { std::cout << "No parameters given at startup." << std::endl; std::exit(1); //Returns with an error message } else { std::cout << "parameters given at startup: " << argv[1] << std::endl; } //Returns without an error message //Equivalent to std::exit(0) return 0; }
- include <iostream>
Topic links
- #include
- scope operator'::'
- stream out operator '<<'
- argc
- argv
- char
- cout
- endl
- iostream
- int
- main
- return
- std
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
