As many as you want. There’s no theoretical limit. I can assure you that you will have other problems before reaching any technical limit (which will be more by available memory limit for the compiler, and we already have plenty).
The problem is that you are thinking the wrong way. You must learn to organize code. Understand the problem and make the most appropriate code possible to solve it. Learning this takes a lot of time, it takes a lot of dedication, and it’s a lot harder than people realize. Doing it anyway and getting it to work is easy, writing quality and lasting code is something much more complicated, and the observation I have is that most of the people who are starting lately aren’t learning this because they just want to see the result, no matter how. In the long run it doesn’t work.
You do not need to put another class there. You can create another file with the new class. Of course, depending on the case, you will have to learn when to put in the same file or not.
But if you want to insist you have to put the class inside the namespace
, I mean, it’s probably possible to put it away, but it’s unlikely that you wanted this. You might even want to create another namespace
outside. Or even nesting them.
You can repeat the namespace
, it is only a surname. Even in different files all types that use the same name of namespace will be part of it.
It would be nice to learn some C nomenclature standards# to go organizing the code.
I don’t know anything that would limit putting two classes in one
namespace
, or using multiplenamespace
s in the same file– Jefferson Quesado