作者ultrafire ()
看板Programming
标题[问题] 请问malloc的用法
时间Fri Sep 21 15:25:16 2007
int *ptr;
1. ptr = malloc(sizeof(int*) * size);
2. ptr = (int*)malloc(sizeof(int) * size);
请问一下
这两种用法在意义上或allocate出来的记忆体
有什麽差别呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.175.233.220