Would you clarify when and why you would use “return 0;” inside a main() as opposed to exit(0) ?
Exit(0) would have cleanup code that return(0) does not? True?
Code:
/* exittest1.c */
#include<stdio.h>
int main() {
int a;
a = 69;
exit(a);
}
and
Code:
/* exittest1.c */
#include<stdio.h>
int main() {
int a;
a = 69;
return(a);
}
How do you obtain the value returned?
“The stuppider I get the smarter I feel”
tia meow
ps do not recall seeing return 0; inside main() before. was looking through the faq and noticed some have it in the examples and some not.