QUOTE(Amadeus @ 25 Feb, 2007 - 10:04 AM)

One basic way is to use two strings -your original string, and a second string you set up to copy to. Use strstr() to search the original string for the first occurrence. Once found, copy all the characters after that to another string (strncpy()). Search that string for the first occurrence, repeat until you've found the last occurrence.
I'm sorry, i still can see it. How do I check if it has found it at all?
CODE
#include <stdio.h>
#include <string.h>
#include <ctype.h>
void main() {
char text[100];
char temp[100];
char *str;
printf("\n Please enter strings: (press return to end)\n");
gets(text);
while (strlen(text) >= 1){
for (int i =0; i <= text[i];i++){
str = strstr (text,"ing");
strncpy (str,temp,text[i]);
str = strstr (temp,"ing");
strncpy (str,text,temp[i]);
}
printf("The string is : %s\n",text);
gets(text);
}
}