0

Help me out with this code plz!

#include<iostream> #include<complex> using namespace std; namespace alpha {int var =0;} namespace beta { int var = alpha :: var +=2; } int main () { beta :: var += alpha :: var; { using namespace beta; cout<< alpha :: var + var; } } i cannot understand what's going on in this code can someone help me understanding this.

14th Dec 2017, 6:17 PM
Shyamal Bhatt
Shyamal Bhatt - avatar
3 Answers
+ 3
Just a wee reminder, please use the code playground so it's easier for us to help you.
14th Dec 2017, 7:11 PM
Learnsolo
+ 1
use the code playground and refer to the c++ course
14th Dec 2017, 7:08 PM
į Œį ŒCode X
į Œį ŒCode X - avatar
0
namespace this is a special place in which you can define variables to avoid name conflicts. http://en.cppreference.com/w/cpp/language/namespace
14th Dec 2017, 10:16 PM
Š˜Š³Š¾Ń€ŃŒ ŠŠ½ŠøŠŗŠøŠ½
Š˜Š³Š¾Ń€ŃŒ ŠŠ½ŠøŠŗŠøŠ½ - avatar