The below described is a program that shows how variables are declared in a dynamic manner. We can also initialize these variables dynamically. Hope this would be so simple for you. By trying some another examples, you can master on it.!
// using simple dynamic initialization of variables
int b,c=sizeof("xloi"); //dynamic initialization for 'c'
cout<<"\nvalue for b=";
int q=b*1.3*c; //dynamic initialization for 'q'