Papers/programming

double pointer memory allocation

tomato13 2008. 1. 21. 16:57
char** CTreeCtrlClient::m_pDir;
void CTestApiDlg::m_init_m_pDir(void)
{
 CTreeCtrlClient::m_pDir = (char**)malloc(sizeof(char*)*100);
 for(int i=0; i<100; i++)
 {
  CTreeCtrlClient::m_pDir[i] = (char*)malloc(sizeof(char)*100);
 }
}

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

class 상호 참조  (0) 2008.02.20
static class  (0) 2008.02.13
[C++] std::list find  (0) 2007.12.06
time calculation  (0) 2007.11.25
simple makefile with macro definition  (0) 2007.11.03