I'm learning C++, and the above code is returning: symbol(s) not found for architecture x86_64
:
#include <iostream>
using namespace std;
class User {
private:
static int counter;
public:
int age;
int getCounter() { return counter; }
};
int main() {
User user;
user.age = 22;
cout << user.getCounter() << endl;
}
I'm learning from a Udemy course, and it should be working, since i'm just copying the content.
Thank you.