I think the title says it all... i'm building a program that will read in a dictionary and then ask the user for a string and will check all permutations of the string against the dictionary to see if it's a word.
but for some reason when i run the program normally it crashes out... but if i run it in debug mode it runs fine... This is the code it gets stuck at
it seems to go through the loop about 8 times then crashes, any help would be appreciated!
but for some reason when i run the program normally it crashes out... but if i run it in debug mode it runs fine... This is the code it gets stuck at
Code:
wordList = (char**)malloc(num * sizeof(char*));
for(i=0;i<num;i++){
fgets(testWord, MAXLENGTH, input);
wordLength = strlen(testWord);
wordList[i] = malloc(wordLength);
strcpy(wordList[i], testWord);
//printf("wordList[%d] = %s", i, wordList[i]);
}
Comment