// Code derived from Stroustrup's PPP2 book// § 8.2.2 Variable and constant declarations// -and beginning on p 262#include<iostream>#include<vector>usingnamespacestd;intmain(){inta;// no initializerdoubled=7;// initializer using the = syntaxvector<int>vi(10);// initializer using the ( ) syntaxvector<int>vi2{1,2,3,4};// initializer using the { } syntaxconstintx=7;// initializer using the = syntaxconstintx2{9};// initializer using the {} syntaxconstinty;// error: no initializer// cout << a << d << x << x2 << '\n';}//------------------------------------------------------------------------------namespaceinnocent{voidf(intz){intx;// uninitialized// ... no assignment to x here ...x=7;// give x a value// ...cout<<x<<z<<'\n';}}// namespace innocent//------------------------------------------------------------------------------namespacedangerous{voidf(intz){intx;// uninitialized// ... no assignment to x here ...if(z>x){// ...}// ...x=7;// give x a value// ...}}// namespace dangerous