I am not sure why I am getting a segmentation fault. It shouldn't be going over the memory I allocated for it, but it seems to be.
Any ideas?
void dsply_chg()
{
ifstream in;
char story[150];
char * target;
in.open("index.dat");
cout<<endl;
cout<<"Changes have been made!";
cout<<endl;
while(in >> story)
{
target = strstr(story, "*adj*");
strncpy(target, "BLAH", 3);
cout<<story<<" ";
}
in.close();
}
It displays "Changes have been made" then says "Segmentation fault". Not sure where it is, and since I am experimenting with functions, I don't know if I am using them wrong or not. So, any ideas?