Dynamic initialization of variables

Explain what is dynamic initialization of the variables?

E

Expert

Verified

C++ allows the initialization of variables at run-time. This is known as dynamic initialization of variables.

In C++, a variable may be initialized at run-time utilizing the expressions at place of declaration as,
……..
…......
int n =strlen(string);
……..
float area=3.14*rad*rad;

Therefore the declaration and initialization is done at the same time at the place in which the variable is used for first time.

   Related Questions in C/C++ Programming

©TutorsGlobe All rights reserved 2022-2023.