64,653
社区成员
发帖
与我相关
我的任务
分享
void ChangeSourceData(int* pSrc)
{
for(int i =0; i < 100; ++i)
pSrc[i] = i;
}
void ChangeSourcePoint(int** ppSrc)
{
int* pInt = (int*)(malloc(sizeof(int)));
(*pSrc) = pInt; // attention: "pSrc = &pInt" is wrong,you can have a deep thinking about the reason!
}
pSrc = &pInt;//只是将临时变量ppSrc的值改了,而需要改变的是ppSrc指向的那个指针的值.