|
Your question isn't really clear. That's why all your answerees are saying, "you meant so-and-so, right?) If you mean, find a substring, Jesse has what you need (unless you just want to roll your own). As Animatronic says, if you just want to get at a specified position in a string, what's wrong with myString [specifiedPosition]? If you want to find a character, there are such things as strchr and ilk. Pay no attention to Serinth's solution, which is just trash. I see no reason to use pointer arithmetic to increment a string's pointer up to what you want when you can go straight there, if you know what you want. If you don't know what you want, you're up shit creek, anyway.
|