作者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