Is 'return 0;' is useless in c ? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Is 'return 0;' is useless in c ?

12th Sep 2019, 8:22 AM
Saurabh Sikligar
2 ответов
+ 2
No, It's not that useless. It prevents you to making syntax errors. Because If your function has some return type then you to return something otherwise it will give you an errors. And in the most of the cases main function has a integer return type as default that's why you have to write return 0;
12th Sep 2019, 8:56 AM
Vijay Meena
0
It's also a the value returned to operative system.
12th Sep 2019, 12:30 PM
AndreaC
AndreaC - avatar