View Single Post
Old Jun 3rd, 2006, 6:47 PM   #2
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 646
Rep Power: 4 Jessehk is on a distinguished road
All I could find was a function that returns a pointer to a sub-string.

http://www.cplusplus.com/ref/cstring/strstr.html

Would that help?

Here's an example:

#include <stdio.h>
#include <string.h>

int main(void) {
	char str[] = "Hello, world!";

	char *subStr = strstr(str, "world");
	printf("%s, %s\n", "Goodbye", subStr);

	return 0;
}

/* OUTPUT:
 * Goodbye, world!
 */
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote