Using calloc() to set up char array, also “freeing” array when done
问题 I'm trying to set up an array of strings (in C, using Linux). The array will hold 11 strings (static length). I initially had the array set up as: char Answers[10][100]; but in my code I have a portion that calls fgets(input,sizeof(input),stdin). When this fgets() portion is called, the final element of my Answers array was being overwritten with the value of input (something about Answers' location on the stack?). So now I'm trying to "lock-in" the memory I use for my Answers array. Would I