#include <iostream>
using namespace std;

class Something
{
private:
    static int s_value;
    int m_value;
public:
    
    
    static int getValue() // getValue()는 특정 instance와 상관없이 사용이 가능하다. int *fptr() = &Something::getValue;
    {
        return s_value; // static은 this->s_value 이런 식으로 쓰지 못한다. this는 non-static에서만 쓸 수 있다.
        // return m_value; 이것도 불가능하다! this를 쓰지 못하기 때문이다. (좀더 생각해봐야할듯)
    }
    int temp()
    {
        return this->s_value; // this : 특정 instance의 주소를 이용하여 instance의 멤버에 접근하겠다는 뜻
    }
};
int Something::s_value = 1024;

int main()
{
    // cout << Something::s_value << "\n"; // public일 경우 선언이 되기 전에도 변수에 접근 가능
    cout << Something::getValue() << "\n"; // 함수를 static으로 선언하여 instance를 통하지 않고서도 접근 가능
    
    
    Something s1;
    cout << s1.getValue() << "\n"; // getValue로 접근 가능
    cout << s1.s_value << "\n"; // 직접 접근 가능
    
    // class의 멤버 변수들은 주소가 instance 마다 다르지만, 함수는 주소가 같다!
    
    return 0;
    
    
    
}