ask a simple question about int pointer.# Programming - 葵花宝典
g*l
1 楼
I was asked such a question: how to determine the size of memory of the int
pointer pointed? for example
int GetTheSizeofMemory(int *buffer)
{
int size;
//enter your code here, to calculate the memory size of buffer point to.
return size;
}
we can not use sizeof(buffer) to get the value, how should we do?
thanks.
pointer pointed? for example
int GetTheSizeofMemory(int *buffer)
{
int size;
//enter your code here, to calculate the memory size of buffer point to.
return size;
}
we can not use sizeof(buffer) to get the value, how should we do?
thanks.