1.

In How Many Ways We Can Initialize An Int Variable In C++?

Answer»

In c++, variables can be INITIALIZED in TWO ways, the traditional C++ INITIALIZATION using "=" OPERATOR and second using the constructor notation.
Traditional C++ initilization
int i = 10;
variable i will get initialized to 10.
Using C++ constructor notation
int i(10);

In c++, variables can be initialized in two ways, the traditional C++ initialization using "=" operator and second using the constructor notation.
Traditional C++ initilization
int i = 10;
variable i will get initialized to 10.
Using C++ constructor notation
int i(10);



Discussion

No Comment Found