Hello been coding in C++ for 3 years using Notepad++ but still need some information so my question is wheres the best location for a namespace declaration?
For example :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//main.cpp
#include <iostream>
namespace TestGroup
{
bool
One = false,
Two = true,
Three = false,
Four = 1,
Five = 0;
}
int main()
{
std::cout << One << Two << Three << Four << Five << std::endl;
std::cout << "Hello there" << std::endl;
return 0;
}
//main.cpp
#include <iostream>
//////////////////////////////////////
namespace TestGroup
{
bool
One = false,
Two = true,
Three = false, ///<------------------- HERE
Four = 1,
Five = 0;
}
////////////////////////////////////////
int main()
{
std::cout << One << Two << Three << Four << Five << std::endl;
std::cout << "Hello there" << std::endl;
return 0;
}
When I mean location , I'm saying where in the main.cpp file does the Namespace declaration which looks like :
1 2 3 4 5 6 7 8 9
namespace TestGroup
{
bool
One = false,
Two = true,
Three = false,
Four = 1,
Five = 0;
}