Reputation: 21
The question is about organizing your own code.
Let's say I have multiple *.cpp and corresponding headers to them and I use some functions from these in another parts of program code. After some time passes I may start to forget which header and cpp a certain function goes from and looking at a simple
func();
tells absolutely nothing.
I can only think of using namespaces so I can later write
Module::func();
Any other ways? I heard using many namespaces isn't a good practice and a bunch of my projects have more than 5-10 cpp's and headers
Upvotes: 0
Views: 47
Reputation: 2604
You can change your project to OOP.
Every .cpp
file will represent single class.
In any part of programm you can see to what object belong called method.
If changing to OOP is problem, you can/must use namespaces. Namespaces only can 'affect' compile-time performance, no other issues can come with it.
Upvotes: 1