Is return and return 0 are same | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Is return and return 0 are same

2nd Oct 2018, 1:51 AM
Ronald
3 Réponses
+ 1
tq
7th Oct 2018, 3:57 PM
Ronald
0
in main function return 0 or exit(0) are same but if you write exit(0) in different function then you program will exit from that position. returning different values like return 1 or return -1 means that program is returning error . ... But destructors are called if return 0 is used. https://cboard.cprogramming.com/cplusplus-programming/170281-return-0;-return-1;.html
7th Oct 2018, 12:09 PM
deepak sharma
deepak sharma - avatar