What is dynamic initialization of object in c++?

前端 未结 4 1129
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 07:11

What is dynamic initialization of objects in c++?

Please explain with an simple example...

4条回答
  •  借酒劲吻你
    2020-11-28 07:35

    Initialization of a variable at the run time from the keyboard is known as Dynamic Initialization.

    Program code:-

     int a=cube(n);
    

    In the above program code , a is a global variable to which a number n is dynamically assigned through a function cube, where cube() performs the cube of a number.

    This is an example of Dynamic Initialization.

提交回复
热议问题