/*Write a new function to allocate a consitentspace for string*/#define NULL 0#define NEWSIZE 1000char newbuf[NEWSIZE];char *newp= newbuf;char *New(int n){ if(newp+n<=newbuf+NEWSIZE) { newp=newp+n; return(newp-n); } else return(NULL);}
本文共 340 字,大约阅读时间需要 1 分钟。
/*Write a new function to allocate a consitentspace for string*/#define NULL 0#define NEWSIZE 1000char newbuf[NEWSIZE];char *newp= newbuf;char *New(int n){ if(newp+n<=newbuf+NEWSIZE) { newp=newp+n; return(newp-n); } else return(NULL);}
转载于:https://www.cnblogs.com/abacuspix/archive/2012/08/08/2629121.html