"yezi" <ye*****@hotmail.com> writes:
My question is I need read from a long string step by step, say first
read length 10 byes of string, process them, then read next 10 bytes of
that string.
Like the file operation fread. there is a pointer forwarding whenever I
read chunk from the file. Is any string read function provide such
kind of mechanism to record current pointer position of string?
No, there's no standard function to do this -- but you don't need one.
All you need to do is keep track of where you are in the string,
either with an integer index or with a pointer.
For example, given:
const char *s = "hello, world";
s is a pointer to a string whose value is "hello, world", and s+7 is a
pointer to a string whose value is "world".
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.