I think the rule you're probably thinking of is if you provide any type of constructor, the compiler will not auto-generate the default constructor for you:
ViggyCode:class Foo { public: Foo(int someNum) : m_Num(someNum) {} private: int m_Num; }; int main() { Foo myFoo; // Should throw a compile error }




Reply With Quote