It's been awhile since I worked with the standard C library's string parsing code (sprintf, atoi, etc).
My specific, current need is as follows:
advance_buf( const char*& buf, const char* removed_chars, int size );
It should advance the buf
pointer to beyond the group of whitespace and copy the removed characters into removed_chars
... The size
is to keep things safe.
Example before and after, state of buf
and removed_chars
:
- Before:
buf
: "123 456 789",removed_chars
: (empty or garbage). - After:
buf
: "456 789",removed_chars
: "123".
I'm also interested in a succinct resource for functions of this sort.