Hi Friends,
I am trying to create a log of some of the outputs. For this I am using
doing the following things...
char * buff = malloc(SIZE);
buff[0] = id_number
len = strlen(data);
memcpy(&buff[1], data, len);
and so on.....
So, in buffer, my data will be ...
1aaaaaaaaaaaa2bbbbbbbbbbbbbbbb3ccccccccccc....
For some reasons, I can not use the Files. So I have to stick to
malloced buffer.
Now, I want to read this data. For me, "1aaaaaaaaaaaa" is one set of
data wherein '1' is the id_number and "aaaaaaaaaaaa" is actual data.
Pls note that length of the actual data is unknown. So practically
there are no delimiters. I was counting on the id_number as the
delimiter. But when I use sscanf, it reads 1a instead of 1.
How can I read this ? Is there any better method?
Thanks in advance,
ImMa...