How can I read a known number of strings of unknown size from a .txt file and store each line in a line of a matrix (in C)?
问题 Title is pretty self explanatory. I'm almost sure that the end result wouldn't be a matrix as each line would have a different number of columns, so it's more like a array of arrays of variable sizes. It would also be interesting to sort the fragments by size, biggest first. This is what I've tried so far: int main() { char str[MAXLEN], **fragmentsList; int number_of_strings, i, max, k; printf("Enter .txt file name: "); scanf("%s", str); printf("How many strings does the file has? "); scanf("