New to the forum and C. I am trying to write a function that will allow me to remove a certian string from and exisiting one. The below program I wrote by using examples in an text book and online. I understand it at a basic level, but I'm pretty lost when it comes to figuring out how the difference array work with one another. Could any one give me some help in getting this going, and maybe point me in the direction of a good piece that explains this in idiot language.
Thanks
#include <stdio.h>
void removeString (char string[], char remove[])
{
int index, source, numchar[81];
for(index = 0; index < 80, index++;)
{
numchar[index]= 0;
}
index = 0;
while(remove[index]) {
numchar[remove[index]] = 1;
index++;
}
index = source = 0;
do
{
if(! numchar[string[index]])
{
string[source++] = string[index];
}
}
while(string[index++]);
}
int main (void)
{
char string[] = "Hello World";
char remove[] = "World";
char result = 0;
removeString(string, remove);
printf ("The Result is %s\n", result);
}