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

Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort

857


Explain binary search.

795


How do I download c++?

735


Define a constructor?

788


What are c++ stream classes?

775


List the features of oops in c++?

767


What is object in c++ example?

833


Is rust better than c++?

824


What is a multimap c++?

859


Implement stack operations with pointers with appropriate exception checks.

755


What is this weird colon-member (" : ") syntax in the constructor?

743


What is endl?

876


Is c++ vector a linked list?

770


What is a block in c++?

781


When is dynamic checking necessary?

794