Home > Back-end >  The program compiled without error, but the connection is shown error, please help solve it
The program compiled without error, but the connection is shown error, please help solve it

Time:10-04

Topic: write a class, declare a data member and a static data members; Declare a static member function to output the static data members, requires the use of constructors to initialize the data members and add 1 static data members, use the destructor to static data members, minus 1, in the main function with two kinds of method calls the static member function,

CodePudding user response:

Int test: : b=0; Static members need to be on the outside of the class initialization,
The static void printb (); Need to add function return value,
  • Related