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 context in c?
Is it better to bitshift a value than to multiply by 2?
How do I determine whether a character is numeric, alphabetic, and so on?
What are lookup tables in c?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
How would you use the functions fseek(), freed(), fwrite() and ftell()?
how can use subset in c program and give more example
How can I implement a delay, or time a users response, with sub-second resolution?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
What are structures and unions? State differencves between them.
Explain why can’t constant values be used to define an array’s initial size?
What is calloc()?
Is c programming hard?
Are local variables initialized to zero by default in c?
Can we declare variable anywhere in c?