Explain the differences between list x; & list x();.
Answer / Rajkumar Sharma
The declarations 'list x;' and 'list x();' both create a new std::list object named 'x', but they differ in how the object is initialized.n
1. list x;: This declaration creates an empty list without performing any initializations.
2. list x();: This declaration creates an empty list using the default constructor, which means that it invokes all the implicitly generated constructors for the specified type and sets up the necessary resources (e.g., memory allocations).
| Is This Answer Correct ? | 0 Yes | 0 No |
How do you master coding?
how to create window program in c++.please explain.
Name four predefined macros.
Explain how functions are classified in C++ ?
What are access specifiers in C++?
What is the difference between reference type and pointers.
Give an example of run-time polymorphism/virtual functions.
What is the difference between = and == in C?
20 Answers Christ University, Intel,
What are pointer-to-members? Explain.
What is the difference between ++ count and count ++?
What is #include iomanip?
In c++, what is the difference between method overloading and method overriding?