What is the difference b/w main() in C language and main()
in C++.
Answer Posted / kishan gowda
Ther is a difference b/w c and c++ main()...After execution
of int main() in c it returns zero on null to the operating
system where as in c++ it returns 1 to the O.S.
Ex:
In c:
int main(){ void main(){
..... .......
..... OR ......
return 0; }
}
In C++:
int main(){ int main(){
..... .......
..... OR ......
return 1; }//by default it retruns 1.
}
| Is This Answer Correct ? | 5 Yes | 12 No |
Post New Answer View All Answers
Explain main function in c?
What is enumerated data type in c?
What will be your course of action for a push operation?
What does the file stdio.h contain?
How many levels of indirection in pointers can you have in a single declaration?
What is the -> in c?
What is the difference between %d and %i?
What is the size of empty structure in c?
What is self-referential structure in c programming?
What is the difference between fread and fwrite function?
What is pointers in c with example?
What is the difference between variable declaration and variable definition in c?
Explain what is the difference between null and nul?
What kind of structure is a house?
What is the use of gets and puts?