Me what's wrong with this counter is ah, why each time debugging output is zero,
CodePudding user response:
Define the num in main. CPP in, or to define num as Complex static membersCodePudding user response:
Num should be defined as static members of the classCodePudding user response:
I see not too clear your code that may not be accurate,Global static, class static, internal static function, can achieve class count,
Key I didn't see you as if the destructor, an object is produced, and then it died, then the class count the same?
And to accurately record the accumulative, want to consider structure, destructor, copy, assign, and so on a series of fuck do,,,,,,,,
CodePudding user response:
Post code, good let us help you debug itCodePudding user response: