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
What is the use of gets and puts?
What is the difference between declaring a variable and defining a variable?
Explain enumerated types in c language?
What is a double c?
Write program to remove duplicate in an array?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
What are the advantages of c language?
Tell me when is a void pointer used?
How many levels of pointers have?
What are the different categories of functions in c?
how to execute a program using if else condition and the output should enter number and the number is odd only...
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is the c language function prototype?
Can we initialize extern variable in c?
How is a macro different from a function?