I have a string with the word scuba in it.
I know how to find it. Well I know how to get a char *c to 's'.
But what I would like to do is search the string for scuba, after finding s with strstr I would like to print all s through a blank space.
Code is as follows:
Code:
char *string1="Hello This is scuba training!";
char *chPtr;
chPtr = strstr(string1, "scuba");
// I know chPtr holds the memory location to 's'
// but how do I turn that into the index number so I can do a for loop
//and print out the rest?