+ 6

Why we use return 0 and getch?

19th Oct 2017, 6:56 AM
Saransh Maurya
Saransh Maurya - avatar
2 ответов
+ 4
if you refering to c or c++ and its main function ... the return 0 defines the programm execution status ... 0 basucally means no errors and everything greater is a error. you do it if you catch an error and dont want the programm to crash (no clean up of resources, no freeing of shared memory , ect) for the second question : getch you have to provide more information or a context
19th Oct 2017, 7:43 AM
Chrizzhigh
Chrizzhigh - avatar
0
it to return nothing in OOP
11th Dec 2020, 10:48 AM
ALEXOP