this is all that is given:
char word[10];
addS("fasten", word);
cout << endl << word << endl; // will output fastens
for a program that must make a word plural (add an s)
here is my code, which compiles but gives a peculiar "segmentation fault" that I haven't seen before..
void addS(char [], char []);
int main() {
char word[10];
addS("fasten", word);
cout << endl << word << endl; // will output fastens
return 0;
} // main
void addS(char orig[], char plural[]) {
int i;
for(i = 0; true ; i++)
plural[i] = orig[i];
plural[i + 1] = 's';
plural[i + 2] = '\0';
}// addS
I'm really lost on this. plz help.