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


Please Help Members By Posting Answers For Below Questions

What are protected members in c++?

718


Define the process of error-handling in case of constructor failure?

656


What are the benefits of oop in c++?

694


How does c++ structure differ from c++ class?

702


What is binary object model?

676






Can we make copy constructor private in c++?

717


How does atoi function work?

745


Write some differences between an external iterator and an internal iterator?

677


How would you differentiate between a pre and post increment operators while overloading?

738


Can we distribute function templates and class templates in object libraries?

675


What is the benefit of c++?

695


What is name hiding in c++?

737


How to get the current position of the file pointer?

646


What is virtual base class?

665


What is searching? Explain linear and binary search.

668