I have a .txt which contains some character and a lot of numbers..
I've made and array, which can contain all these numbers, but don't know how to start from that line where the numbers begin, i only want's to store the numbers since my array is a int type.. How do i read from a certain line to the end of a .txt file?
My point was, your code had three nested loops, I reduced it to two. I also made a significant change by moving the is >> operation from its position outside both for loops, and placed it inside the innermost loop.
I didn't test the code so far, there may be a bug which I didn't notice.
One of the difficulties i had was in understanding the ignore() statements, as I'm not clear on the contents of the file. A sample of the data might be useful.
Thanks for the reply. Just one more question, and I don't know whether this is even a sensible one or not. I noted from the earlier code that you have a variable size array, determined by the values of length and height. Is your code currently reading those two values from the file, or are they derived in some other way, for example user input.
Sorry about muddying the waters here, since I know this isn't what you were asking about. However it seemed relevant if I wanted to test your code myself.
the .txt file contains the length and height off the array..
so no userinput..
The text portion will always contain information about the length and the height.
I don't understand the read data section..
Using my while i cann Cout the content, but not store it.
"is" is reffering to the class, but how can it reffer to a line?