标签:style blog color ar sp div c log amp
void getMemory(char *p) { p=(char *)malloc(100); } char * getMemory(char *p) { char ch[]="hello world"; return ch; } char * getMemory(char **p) { *p=(char*)malloc(100); return *p; } int main() { char *str=NULL; // getMemory(str); getMemory(&str); if(str!=NULL) cout<<"get Memory success"<<endl; }
标签:style blog color ar sp div c log amp
原文地址:http://www.cnblogs.com/huangcongcong/p/4003426.html