POSIX.1 将 read函数的原型做了修改,经典的定义为 int read(int filedes, char *buf, unsigned nbytes); 修改为 ssize_t read(int filedes, void *buf, size_t nbytes); 主要从以下几个方面考虑 First, the second argument was changed from a char * to a void * to be consistent with ISO C: the t…
http://stackoverflow.com/questions/3523145/pointer-arithmetic-for-void-pointer-in-c When a pointer to a particular type (say int, char, float, ..) is incremented, its value is increased by the size of that data type. If a void pointer which points to…
原函数是<The C programint language >5.11文本行排序的程序,如下: void qsort(void *v[], int left, int right, int (*comp)(void *,void *)) { int i,last; if( left >= right) return; swap(v,left,(left+right)/2); last = left; for(i = left + 1; i <= right; ++i) if(c…