I was wondering if the following is considered poor practice, as the object is not
created in main.
I placed this sort of thing in a header file and linked it and had no errors, but Dev showed that the object I had created from the class was global, as it was seperate from main.
Code:#ifndef HEADER_H #define HEADER_H class Foo { public: Foo() {}; ~Foo(); private: int something; }; Foo fo; // this is considered global, is this poor practice #endif



LinkBack URL
About LinkBacks


