Why is main an int?



Why is main an int?..

Answer / Mukesh Kumar

In C++, the main function must return an integer value indicating the status of the program execution. This is a convention inherited from the C programming language, where the main function's return type is also int.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

How many static variables are created if you put one static member into a template class definition?

1 Answers  


What is the difference between strcpy() and strncpy()?

1 Answers  


How would you call C functions from C++ and vice versa?

1 Answers   Genpact,


What does return 0 do in c++?

1 Answers  


List out some of the object-oriented methodologies?

1 Answers  


What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?

1 Answers  


What is a concrete class?

1 Answers  


What does namespace mean in c++?

1 Answers  


Explain the difference between realloc() and free() in c++?

1 Answers  


What is c++ hash?

1 Answers  


how to explain our contribution in the project?

1 Answers   Wipro, Yahoo,


In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest.

5 Answers   GE,


Categories