A function for new storage space of string

/*
Write a new function to allocate a consitent
space for string
*/

#define NULL 0
#define NEWSIZE 1000
char 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/p/2629121.html