I need to basically read in a file using the open system call, and then read each line and strtok each line by a space.
For example - this file:
Name1 1 3 Name2 4 1 Name3 90 20 Name4 20 3 Name5 56 2 Name6 23 9 Name7 45 13 Name8 12 18 Name9 78 5 Name10 56 8From each of these lines i need three outputs e.g: (Name1, 1 and 3)
These need to be put into an array for sorting by the third column in numerical order, producing the final output:
Name2 4 1 Name5 56 2 Name1 1 3 Name4 20 3 Name9 78 5 Name10 56 8 Name6 23 9 Name7 45 13 Name8 12 18 Name3 90 20I have tried to do this but it just keeps on erroring with a stack error.
Any suggestions?














