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.
3 Answers
+ 3
Just a wee reminder, please use the code playground so it's easier for us to help you.
+ 1
use the code playground and refer to the c++ course
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