hey everyone, I'm supposed to make a program that can read up to 1000 lines(and place each line inside an array) and then make it output in reverse order. Now everything was going great till I decided to do some final testing before handing it in. I change the const int to 5 for the sake of testing and once the program reads in the 5th line it crashes. I've tried all the methods of my knowledge to fix it but have had no luck. Can anyone help me out with this, please?
it's because you're accessing an index that doesn't exist([5] at line 32). I recommend you to use stl containers, such as vector or list to hold your data.