Carriage return- How to identify?
-
Hi, how can I identify a carriage return (\n)using fscanf ? Thanks, Deepak Samuel.
-
Hi, how can I identify a carriage return (\n)using fscanf ? Thanks, Deepak Samuel.
-
I am scanning the file for interger values what happens if my file itself contains a integer value of 13 ? How can I differentiate between my data and a carriage return?` Thanks, Deepak Samuel
-
I am scanning the file for interger values what happens if my file itself contains a integer value of 13 ? How can I differentiate between my data and a carriage return?` Thanks, Deepak Samuel
Maybe you can tell by looking for CR, LF...at the end of each line.
-
I am scanning the file for interger values what happens if my file itself contains a integer value of 13 ? How can I differentiate between my data and a carriage return?` Thanks, Deepak Samuel
Character 13 and number 13 are totally different things. When using
fscanf()
, you must tell it what type of data is being read. In other words:char c;
fscanf(pFile, "%c", &c);This will not read the number 13 from the file. Likewise:
int n;
fscanf(pFile, "%d", &n);This will not read the character 13 from the file. Make sense?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen