So i have a piece of code with a class like that:
#include<iostream>
#include<cstring>
class stu
{
static int proba;
public:
stu();
static int no(){
return proba;
}
};
int stu::proba=0;
stu::stu()
{
proba=proba+1;
}
int main()
{
std::cout<< stu::no << std::endl;
}
The output is 1.
It does so even if i change stu::no
so that it would be only {return 12;}
Why does it happen? How do I fix it??