In how many ways we can initialize an int variable in C++?
Answer Posted / hrpynux@gmail.com
For example, to declare a variable of type int called x and initialize it to a value of zero from the same moment it is declared, we can write: int x = 0; A second method, known as constructor initialization (introduced by the C++ language), encloses the initial value between parentheses ( () ):
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are protected members in c++?
Define the process of error-handling in case of constructor failure?
What are the benefits of oop in c++?
How does c++ structure differ from c++ class?
What is binary object model?
Can we make copy constructor private in c++?
How does atoi function work?
Write some differences between an external iterator and an internal iterator?
How would you differentiate between a pre and post increment operators while overloading?
Can we distribute function templates and class templates in object libraries?
What is the benefit of c++?
What is name hiding in c++?
How to get the current position of the file pointer?
What is virtual base class?
What is searching? Explain linear and binary search.