#include <iostream> //#include <cstdio> //#include <vector> //#include <iostream> //#include <algorithm> #include <list> // for arra list list<foodIdeams>.... //using namespace std; //std:: not using namespace exsample namespace Happy { int num = 32; std::string name = "Jarod"; } namespace Sad { int num = 42; std::string name = "Sid"; } int main() { std::cout << Happy::name << std::endl; std::cout << Happy::num << std::endl; std::cout << "" << std::endl; std::cout << Sad::name << std::endl; std::cout << Sad::num << std::endl; return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter