ok so i want to read / write numbers from a file.txt .
how do i tell the machine to do particular things if i come to the end of a line...or at the beginning of a line ?
i dont mean EOF..end of file.. but i will like to do particular things at the beginning of the line and at the end of every row or line..
thanks for your answers in advance :)
Write your question here.
ok so i want to read / write numbers from a file.txt .
This is a very broad question. Do you use C or C++ IO facilities? How do you read something? Do you use formatted input? And so on. Code example would be good here.
One of the solutions in your case would be to read file line by line:
c++ or better still c++ 11 ...do i really need to give a code?
assume you having a text file containg some random numbers like this
21 34 32
22 12 23
34 34 34
just like how you see these numbers...
after reading the first line and arriving at 32...i will like to stop and do something..
then on before reading 22 i will like to do something...
at after reading 23 last number...i will like to be able to do... :: if 23 is last number on line...do something..then... if new line...do something before starting reading...