I have created a small program where it uses static void function to get the number and another static void function to display the number. But when ever the application runs, it gives me this error
Error 1 error LNK2001: unresolved external symbol "private: static int Thing::i" (?i@Thing@@0HA)
And here is my code
#include <iostream>
using namespace std;
class Thing{
private:
static int i;
public:
static void set_i(int h){
i = h;
}
static void print_i(){
cout << "The value of i is: " << i << endl;
}
};
int main(){
Thing::set_i(25);
Thing::print_i();
system("pause");
return 0;
}