in c/cpp, how can we check the returned value to the OS of main(or exit, ...) function? just i want to know. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

in c/cpp, how can we check the returned value to the OS of main(or exit, ...) function? just i want to know.

in c/cpp, we know that the main(or exit sometime) function returns 0 for success and non-zero for failure of the program to OS.

18th Oct 2017, 6:22 AM
Rehan Q
Rehan Q - avatar
1 Answer
+ 1
You will have to use your operating system's API, which of course is dependent on the target OS.
18th Oct 2017, 6:51 AM
aklex
aklex - avatar