Is it possible to access to access and use static members within a class without first creating a instance of that class? Ie treat the the class as some sort of dumping ground for globals
James
Yes, it's precisely what static means for class members:
struct Foo {
static int x;
};
int Foo::x;
int main() {
Foo::x = 123;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With