how does a main() in C++ is different from main() in C?

Answer Posted / vishal palan

In C the main() does not return any value by default. But in C++ the main() returns value int by default.
Again
In U can complie progm by writing main(){....}
But in C++ u have to return int main() {...return 0;}
or void main() {...}

Is This Answer Correct ?    16 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is encapsulation in oop?

599


What is variable example?

591


can we make game by using c

3409


Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

622


any one please tell me the purpose of operator overloading

1960






what is difference between class template and template class?

2153


Get me an image implementation program.

1555


What is difference between polymorphism and inheritance?

612


What is abstraction and encapsulation?

565


write knight tour problem which is present in datastructure

2159


What is persistence in oop?

664


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

1630


Can abstract class have normal methods?

603


What is encapsulation and abstraction? How are they implemented in C++?

628


What is the types of inheritance?

594