No code here, just wondering what can i do with namespace? I saw a lot of strange uses of it,like use namespace life...:D
Also...
BEGGINNERS,WHAT ABOUT SKYPE CHAT GROUP?
BECAUSE SERIOUSLY...to do it alone is like - not just a little bit boring sometimes,but much longer,we may share some ideas,as we all are begginners and we want the same thing :)
If you are looking positive to this and you think it would be nice to have chat like this - add me in skype -> mantasxxl3
I would create it only then,if at least 5 people show that the idea is quite good.
#include <iostream>
namespace life1
{
constunsignedint a = 5;
void function( void )
{
std::cout << "This is the life1 namespace!" << std::endl;
std::cout << "A from this namespace is = " << a << std::endl;
std::cout << "------------------------------" << std::endl;
}
}
namespace life2
{
constunsignedint a = 10;
void function( void )
{
std::cout << "This is the life2 namespace!" << std::endl;
std::cout << "A from life1 is = " << life1::a << std::endl;
std::cout << "A from this namespace is = " << a << std::endl;
std::cout << "------------------------------" << std::endl;
}
}
void function( constunsignedint a )
{
std::cout << "This is not in a namespace!" << std::endl;
std::cout << "A from function without namespace = " << a << std::endl;
std::cout << "------------------------------" << std::endl;
}
int main( void )
{
constunsignedint a = 1;
function( a );
life1::function();
life2::function();
std::cout << "A from main function is: " << a << std::endl;
std::cout << "A from namespace life1 is: " << life1::a << std::endl;
std::cout << "A from namespace life2 is: " << life2::a << std::endl;
return( 0 );
}
This is not in a namespace!
A from function without namespace = 1
------------------------------
This is the life1 namespace!
A from this namespace is = 5
------------------------------
This is the life2 namespace!
A from life1 is = 5
A from this namespace is = 10
------------------------------
A from main function is: 1
A from namespace life1 is: 5
A from namespace life2 is: 10
Process returned 0 (0x0) execution time : 0.025 s
Press any key to continue.