ok so it works fine when its one #
Code:
#include <iostream.h>
#include <string.h>
int main()
{
char story[100]="Bugsy Kludge is a # with our company.";
char findnouns[2]="#";
char nouns[10]="vegetable";
char copystory[100];
cout<<story<<endl;
int length=strlen(story), length2=strlen(nouns), count=0, count2=0, count3=0;
for(count=0;count<length;count++)
{
if(findnouns[0]==story[count])
{
strcpy(copystory,story);
for(count2=count;count2<(count+length2);count2++)
{
story[count2]=nouns[count3];
count3++;
}
length=length+length2;
story[count+length2]=' ';
for(count2=(count+length2+1);count2<length;count2++)
{
story[count2]=copystory[count2-length2+1];
}
}
}
cout<<story;
cout<<endl;
return (0);
}
so why wont it work when i have 2 #'s?
can someone help me this is really puzling