Hi There.
I have to create a function that will take a sentence and breakout the
words and save them into an array. For some reason, I can't get it
working. I keep getting a segmentation fault being caused by
strcpy(). Can someone please tell me what I'm doing wrong:
88 void displayPigLatin(char *str) {
89 void encode(char *sPtr);
90
91 char
92 *arrStr[MAXWORDS][WORDSIZE],
93 *tokenPtr,
94 *tmpStr;
95
96 int cnt;
97
98 strcpy(arrStr[0][0], str);
99 tokenPtr = strtok(arrStr[0][0], " ");
100 printf("%s\n", tokenPtr);