Home > Back-end >  This is a function of a number of statistical calls the constructor
This is a function of a number of statistical calls the constructor

Time:01-03

# include "iostream"
using namespace std;
Class A
{
Public:
Static int count;
(A)
{
count++;
}
Int switchcount ()
{
return count;
};


};
Int A: : count=0;
Int main ()
{
A, A.
coutA, b.
cout}
Excuse me this static count what pay attention to? Will their

CodePudding user response:

Class what is a static member function in there, banging bam,

CodePudding user response:

Static members only outside the class initialization,
  • Related