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