Re: fstream ?

From: Howard (alicebt_at_hotmail.com)
Date: 09/30/04


Date: Thu, 30 Sep 2004 17:04:09 GMT


"Karl Heinz Buchegger" <kbuchegg@gascad.at> wrote in message
news:415BF88E.F62E6072@gascad.at...
>
> Best is often: read with getline, and look at the last character in the
string.
> If it is a '\n', discard it.
>

I've got a question on comparing a char against '\n'. Since on some
systems, '\n' is represented by #13#10 (a CR/LF pair), what happens when you
compare a char with it? Is there some internal mechanism that actually
compares two bytes instead of just one?

-Howard



Relevant Pages

  • Re: Encoding difference in Vista breaks my app :(
    ... i've done some more testing and found that it wasn't safe to discard anything above ASCII 179. ... a working version is to open up the hashed string into a Char array, and then check if the integer value of each one is 65533. ...
    (microsoft.public.dotnet.framework.clr)
  • Re: char * type in a regular dll call
    ... string? ... Use TCHAR and _tcscmp. ... exported from regular MFC dll with parameters of type: char * (pointer to ... The above is comparing pointers, presumably you want to compare the ...
    (microsoft.public.vc.mfc)
  • Re: Performance RPG Figurative Constants versus Literals
    ... in compilation times between the two methods, ... I would suspect that the compiler would store *blanks as a single byte ... I would also suspect that comparing ... a 132 character string to a figurative constant would be quicker in the ...
    (comp.sys.ibm.as400.misc)
  • Re: A more efficient way
    ... > Is there a more efficient way of comparing a string to different words? ... the limit," 20.17's suggestion leads to hashing schemes which ...
    (comp.lang.c)
  • Re: if question
    ... >> performed before comparing. ... > and boolean is the simplest type. ... Why convert the string to boolean? ...
    (microsoft.public.scripting.jscript)