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 |
Explain Function Pointer?
c program to input values in a table(using 2D array) and print odd numbers from them
how does the C compiler interpret the following two statements p=p+x; q=q+y; a. p=p+x; q=q+y b. p=p+xq=q+y c. p=p+xq; q=q+y d. p=p+x/q=q+y
What does the file stdio.h contain?
What are identifiers in c?
Difference between macros and inline functions? Can a function be forced as inline?
0 Answers HAL, Honeywell, Zomato,
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
We can draw a box in cprogram by using only one printf();& without using graphic.h header file?
Why can arithmetic operations not be performed on void pointers?
What are the types of macro formats?
You have an array of n integers, randomly ordered with value 1 to n-1.The array is such that there is only one and one value occurred twice. How will you find this number?