char *Strip (char *str)
{
const int x = strlen (str) + 1;
char *buff1 = new char [x];
char buff2 [25];
strcpy (buff1, str);
for (int y = 0; y < x; y++)
{
if (buff1 [y] != ',')
buff2 [y] = buff1 [y];
else
{
buff2 [y] = NULL;
break;
}
}
delete buff1;
return buff2;
}
is buff2 a reliable return pointer.
the code works but I seem to recall that
the memory space is not reliable for repeated
references to it by way of this pointer.
is it reliable for this usage.
Fields.push_back (Strip (a));
feel free to be harshly critical
tomcruz.net
{
const int x = strlen (str) + 1;
char *buff1 = new char [x];
char buff2 [25];
strcpy (buff1, str);
for (int y = 0; y < x; y++)
{
if (buff1 [y] != ',')
buff2 [y] = buff1 [y];
else
{
buff2 [y] = NULL;
break;
}
}
delete buff1;
return buff2;
}
is buff2 a reliable return pointer.
the code works but I seem to recall that
the memory space is not reliable for repeated
references to it by way of this pointer.
is it reliable for this usage.
Fields.push_back (Strip (a));
feel free to be harshly critical
tomcruz.net