Right now I am creating a vector in a header file. Mind, I'm not just declaring it.
std::vector<int> attacked_nodes = std::vector<int> ();
It works fine, but it's giving me some doubts. This is not in the context of a proper class, it's just a variable used by many functions.
I'd like to know if this is
- correct (will it backfire?)
- acceptable practice (it's probably not good)
I've searched around, yes.
NOTICE: this is probably a bad coding practice, I get it. What i want to know is if it actually incorrect?
I'd prefer not to use new to create a pointer, maybe I could use new and save a reference? It's still inelegant, but may work.
Thanks.