I have a text file where the first number is the total number of arrays.
The second number in the file is the total amount in the first array.
Each array has a different number of variables.
I know that for loops are my friend here and understand how they work.
However, I am having trouble with the logic to read in from the file.
Still can't seem to print out the last number in each array.
If I change the 1 to a 0 in the loop's, the program prints everything in the first array but crashes the program before getting to the next array.
Suggestions?
I'm not sure why the function loadData() is reading both count and size.
Based on the contents of the file, count occurs just once at the start.
pseudocode:
read count
then repeat count times:
read size
repeat size times:
read number
Pseudocode - well, it doesn't necessarily have too many rules.
The main thing is to convey the meaning without getting bogged down in the details of syntax, but it can contain actual code mixed with ordinary English. Mostly the idea is to keep things simple.
Other people may disagree or have other ideas, and that's fine too.