It may be breaking the laws of OOP but I was just wondering if it was possible in C++.
I don't feel like it is breaking the laws of OOP. It depends on what you need. Sometimes it is used as it is the most convienient approach. Please see info about singleton pattern. It is considered an alternative to global variables.