-
ASCII cuestion
I have a little cuestion... what is the ASCII number for the enter??
I have the next code:
#include <fstream.h>
void main()
char a[10];
ifstream file("abc.txt");
int line=1;
while(!file.eof()){
if(char[0]=="ascii number")
linea++;
}
}
what I need is to record the number of the line that I'm reading.
-
It depends on how you're reading the input.
Unless you're reading in binary mode (or are doing something strange with file.get() or file.getline()) you'll probably never read an 'enter' into one of your arrays.
Using the text input functions will stop reading at the end of line so you don't have to check for it's presence.
-
'enter' or 'return' can mean different things... but there are two characters which serve this purpose... 10 and 13... the CR [carriage return] and LF [line feed]...
er, i may have them switched...
hth! [or at least a 50 percent chance of so...]