View Single Post
Old Jun 30th, 2005, 1:57 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
The pointer you pass represents the beginning of a string. There is no requirement that it be at the beginning of a defined array of char, only that the data from that point onwards qualifies as a string (zero or more char followed by a null terminator).

The pointer returned represents the beginning of the substring. If you increment the pointer from that position, that particular substring can no longer be found; only the characters beyond that position, up to the terminator, are subsequently searched.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote