阅读背景:

free怎么知道要免费多少钱?

来源:互联网 

In C programming, you can pass any kind of pointer you like as an argument to free, how does it know the size of the allocated memory to free? Whenever I pass a pointer to some function, I have to also pass the size (ie an array of 10 elements needs to receive 10 as a parameter to know the size of the array), but I do not have to pass the size to the free function. Why not, and can I use this same technique in my own functions to save me from needing to cart around the extra variable of the array's length?In C programming, you can pass any kind of poin




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: