2010年10月1日

指针地址的修改

摘要: 看到下面这个改错题:void GetMemory( char *p ){ p = (char *) malloc( 100 );}void Test( void ){ char *str = NULL; GetMemory( str ); strcpy( str, "hello world" ); printf( str );}没反应,不知道是哪里有问题,怀疑是GetMemory函数可能有问题。在... 阅读全文

posted @ 2010-10-01 17:20 非常笑 阅读(3167) 评论(1) 推荐(3) 编辑

导航