Design
aa0198.txt
Associated article: Algorithm Alley
Tags: Design
Published source code accompanying the article by John Boyer in which he discusses pits the flexibility of resizable data structures with the speed of array-based structures. Also see AA0198.ZIP.
Algorithm Alley
by John Boyer
Listing One
char *lex_growbuffer(char *Buffer, long *pBufferSize)
{
char *TempP;
long NewSize;
if (*pBufferSize==0) NewSize = 16;
else NewSize = *pBufferSize * 2;
TempP = (char *) realloc(Buffer, NewSize+1);
if (TempP != NULL) *pBufferSize = NewSize;
return TempP;
}
... /* Snippet to add a ...


