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 are the advantages of early binding?

0 Answers  


What does extern mean in a function declaration in c++?

0 Answers  


How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?

0 Answers  


What does count ++ do in c++?

0 Answers  


What problem does the namespace feature solve?

1 Answers  


What is insertion sorting?

0 Answers  


What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor

0 Answers  


How do I write a c++ program?

0 Answers  


In which memory a class gets stored(in heap /in stack)? And why??

2 Answers  


What is data binding in c++?

0 Answers  


why can't we declare data member of class auto register or extern

1 Answers  


Where do I find the current c or c++ standard documents?

0 Answers  


Categories