L
LuTHieR
Hi,
I'm reading a string of numbers from a file (using Borland C++ Builder
6), and I'm doing it like this: first I use FileRead to store all the
data in the file to a char* variable (appropriately called 'data').
Then, I read every number using
char *ptr;
int value;
[...]
ptr = &data[position];
sscanf (ptr, "%i", &value);
position += IntToStr(value).Length();
numbers = value;
(All of it inside of a loop, of course).
This method seems to be working OK, but Borland CodeGuard tells me that
there's an access overrun in each sscanf call, so I guess there is a
better way of doing it. Could you please help me?
Big thanks,
LuTHieR
I'm reading a string of numbers from a file (using Borland C++ Builder
6), and I'm doing it like this: first I use FileRead to store all the
data in the file to a char* variable (appropriately called 'data').
Then, I read every number using
char *ptr;
int value;
[...]
ptr = &data[position];
sscanf (ptr, "%i", &value);
position += IntToStr(value).Length();
numbers = value;
(All of it inside of a loop, of course).
This method seems to be working OK, but Borland CodeGuard tells me that
there's an access overrun in each sscanf call, so I guess there is a
better way of doing it. Could you please help me?
Big thanks,
LuTHieR