In C++, and in C99 and C11, it is a special rule of the language that if the control flow reaches the end of the main
function, then the function impliclty returns 0
.
More Related Contents:
- Why should I not #include ?
- Why doesn’t a simple “Hello World”-style program compile with Turbo C++?
- Mouse program in Turbo CPP
- positioning pie slice problems
- Pass by Reference / Value in C++
- std::vector::resize() vs. std::vector::reserve()
- Difference between files written in binary and text mode
- How to call C++ function from C?
- Why does stringstream >> change value of target on failure?
- Is null reference possible?
- Why does printf() promote a float to a double?
- C++ Static member method call on class instance
- Cannot convert parameter from ‘const char[20]’ to ‘LPCWSTR’
- Nonfree module is missing in OpenCV 3.0
- C++ Error: undefined reference to `main’
- How to filter items from a std::map? [duplicate]
- Is the use of std::vector objects in C++ acceptable, or should I use an alternative?
- What are the differences between overriding virtual functions and hiding non-virtual functions?
- When including header files, is the path case sensitive?
- Heap Corruption while using CreateWindowExW
- App does not run with VS 2008 SP1 DLLs, previous version works with RTM versions
- How to get a color palette from an image using OpenCV [closed]
- Behaviour of malloc with delete in C++
- Can branches with undefined behavior be assumed unreachable and optimized as dead code?
- How to set ROI in OpenCV?
- What happens before main in C++?
- What are the differences between std::variant and boost::variant?
- How is a bool represented in memory?
- No == operator found while comparing structs in C++
- Differences of using “const cv::Mat &”, “cv::Mat &”, “cv::Mat” or “const cv::Mat” as function parameters?