how to get return value from function to main in c++ code example Example: c++ check function return value #pragma GCC diagnostic error "-Wreturn-type"