What is the difference b/w main() in C language and main()
in C++.
Answers were Sorted based on User's Feedback
Answer / vignesh1988i
there is no difference between main() in both of the
languages...... in c++ we will see all intrerms of
objects.... thats all......
| Is This Answer Correct ? | 13 Yes | 5 No |
Answer / gganesh
In c, main function will execute starting itself.
In c++, main function will execute finally
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / ayush jindal
in c & c++
the main difference is that "c" is based on top to bottom
approach.in "c"languge the header file is used as
#include<stdio.h> its also programable language.
& in c++ is based on bottom upto top approach. in c++ the
header file is used as #include<iostream.h> is used. is
also based on "object oriented program".
| Is This Answer Correct ? | 4 Yes | 5 No |
Answer / ayush
there is no difference b/w in c & c++ in main() function.
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / sagarika
In C language , main() does not return any value.
Hence there is no need of return type whereas in c++ main
returns the value. if there is no return type we should
specify it by writing the keyword void before main.
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / ppp
In c:
int main(){ void main(){
..... .......
..... OR ......
return 0; }
}
| Is This Answer Correct ? | 2 Yes | 6 No |
Answer / 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 |
How do you do dynamic memory allocation in C applications?
int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
What are the different types of objects used in c?
What is c system32 taskhostw exe?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Explain what is wrong with this statement? Myname = ?robin?;
Apart from dennis ritchie who the other person who contributed in design of c language.
suppose we use switch statement and we intilize years name using enum statement like(jan,feb,mar,------dec) we take integer value as an input .question is that the month which we analyz is from 0 to 11 bt if i enter 12 than how he again starts from begning and print jan
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
Can we increase size of array in c?
what is the difference between these initializations? Char a[]=”string”; Char *p=”literal”; Does *p++ increment p, or what it points to?