【发布时间】:2010-11-08 09:07:31
【问题描述】:
我遇到了一个小问题,需要一些帮助:
如果我有一个分配的字符缓冲区,并且我有一个起点和终点位于该缓冲区内的某处,并且我想要这两点之间的长度,我该如何找到它?
即
char * buf; //malloc of 100 chars
char * start; // some point in buff
char * end; // some point after start in buf
int length = &end-&start? or &start-&end?
//How to grab the length between these two points.
谢谢
【问题讨论】: