In how many ways we can initialize an int variable in C++?



In how many ways we can initialize an int variable in C++?..

Answer / 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

More C++ General Interview Questions

What happens if an exception is throws from an object's constructor and from object's destructor?

3 Answers   TCS,


What happens when the extern "c" char func (char*,waste) executes?

0 Answers  


What is c++ programming language?

0 Answers  


When is the destructor called?

0 Answers  


How will you call C functions from C ++ and vice-versa?

0 Answers   Agilent, Tavant Technologies, Thomson Reuters, Verifone,






Why main function is special in c++?

0 Answers  


Is it possible to provide special behavior for one instance of a template but not for other instances?

0 Answers  


Consider the following code fragment: int main(void) { int m = 4; mystery ( m ); mystery ( m ); printf("%d", m); return 0; } What is the output on the monitor if mystery is defined as follows ? void mystery (int m) { m = m+3; }

2 Answers   CDAC, Wipro,


What are the syntactic rules to be avoid ambiguity in multiple inheritance?

0 Answers  


Should you pass exceptions by value or by reference?

0 Answers  


Explain the difference between c & c++?

0 Answers  


What is static function? Explain with an example

0 Answers  


Categories