Hello everyone i need some help figuring this out.
My question is asking me Write a program that creates an array of 100 string objects. Fill the array by having your program open a (text) file and read one line of the file into each string until you have filled the array. Display the array using the format “line #: <string>,” where # is the actual line number (you can use the array counter for this value) and <string> is the stored string.
Now when i compile this my line count starts at 0 and instead of 1 is this technically right what i have or is there another way of going about it?
The file will stop reading once the array is full. Unless you mean the file is too short. If that is the case then he needs to chose a bigger file because he said he needs to fill an array of 100.
The file will stop reading once the array is full. Unless you mean the file is too short. If that is the case then he needs to chose a bigger file because he said he needs to fill an array of 100.
There is a big difference between what you need and what you have.