Papers/programming

The usage of a static class function by an object

tomato13 2008. 3. 12. 10:41

class CTC12
{
public:
          CTC12() {
                  OutputDebugString("Construnctor\n");
          }
          ~CTC12() {};

 

          static int m_SetValue(int nVal){
                  m_nVal = nVal;

                  return 1;
          }

 

          static int m_GetVale()
          {
                  return m_nVal;
           }

 

private:
           static int m_nVal;
};

 

int CTC12::m_nVal;

void TC12()
{
          CTC12* pTC12 = new CTC12();
          pTC12->m_SetValue(10);

          delete pTC12;
}

'Papers > programming' 카테고리의 다른 글

polymorphism  (0) 2008.03.16
_msize  (0) 2008.03.13
[debug problem] memory allocation  (0) 2008.03.04
debugging problem  (0) 2008.02.26
class 상호 참조  (0) 2008.02.20