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 |
How many static variables are created if you put one static member into a template class definition?
What is the difference between strcpy() and strncpy()?
How would you call C functions from C++ and vice versa?
What does return 0 do in c++?
List out some of the object-oriented methodologies?
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?
What is a concrete class?
What does namespace mean in c++?
Explain the difference between realloc() and free() in c++?
What is c++ hash?
how to explain our contribution in the project?
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.