#include <iostream>
using namespace std;
struct SomeType {
void someMethod();
static int cnt;
};
int SomeType::cnt;
void SomeType::someMethod() {
cout << "cnt" << cnt;
++cnt;
}
int main() {
SomeType someVar;
SomeType *ptrSomeType = new SomeType();
(*ptrSomeType).someMethod();
delete ptrSomeType;
(&someVar)->someMethod();
return 0;
}
Login in to like
Login in to comment