char *substr(char *base, int start, int length)
{
int i = 0, j = 0, baselength = 0;
while(base[i++] != '\0')
baselength++;
if(length > baselength)
return "=NULL=";
char* substring = new char[length + 1];
for (i = start; i < length + start; i++, j++)
substring[j] = base[i];
substring[j] = '\0';
return substring;
}
Thanks.
Later,
ZE.
[EDIT: code formatting (still doesn't look right)]
//email me.//zealouselixir software.//msdn.//n00biez.//miscellaneous links
[if you have a link proposal, email me.] Edited by - zealouselixir on February 6, 2002 1:25:55 PM