Witam,
Czemu taki zapis nie dziala?
#include <iostream>
using namespace std;
class kk
{
public:
static int k;
};
int kk::k = 5;
int main()
{
cout << kk:k << endl;
system("pause");
}
Witam,
Czemu taki zapis nie dziala?
#include <iostream>
using namespace std;
class kk
{
public:
static int k;
};
int kk::k = 5;
int main()
{
cout << kk:k << endl;
system("pause");
}
Bo napisałeś:
cout < kk:k << endl;
A ma być:
cout << kk::k << endl;
Ten kod to całkowita porażka... gdzie tworzysz instancje klasy?