nextline statement in write function

Discussion in 'C++' started by ChrisC, Feb 9, 2004.

  1. ChrisC

    ChrisC Guest

    how would I put a '\n' in say outfile.write( record, sizeof(record)).
    Thank you in advance for your help.
    --
    ChrisC -
    ChrisC, Feb 9, 2004
    #1
    1. Advertising

  2. "ChrisC" <> wrote...
    > how would I put a '\n' in say outfile.write( record, sizeof(record)).


    What the hell do you mean? Do you mean, how to output a \n using
    ostream::write? That's simple:

    outfile.write("\n", 1);

    Since it's so simple, I doubt you're asking about that. So, what
    is this "put '\n' in say outfile.write ..."?

    V
    Victor Bazarov, Feb 9, 2004
    #2
    1. Advertising

  3. "Victor Bazarov" <> wrote in message
    news:SfRVb.264899$na.421405@attbi_s04...
    > "ChrisC" <> wrote...
    > > how would I put a '\n' in say outfile.write( record,

    sizeof(record)).
    >
    > What the hell do you mean? Do you mean, how to output a \n using
    > ostream::write? That's simple:
    >
    > outfile.write("\n", 1);
    >
    > Since it's so simple, I doubt you're asking about that. So, what
    > is this "put '\n' in say outfile.write ..."?


    Maybe he means this:

    outfile.write( record,
    sizeof(record) );

    Jonathan
    Jonathan Turkanis, Feb 9, 2004
    #3
  4. ChrisC <> writes:

    > how would I put a '\n' in say outfile.write( record, sizeof(record)).
    > Thank you in advance for your help.


    "\\n"
    Billy O'Connor, Feb 9, 2004
    #4
  5. ChrisC

    Jeff Schwab Guest

    Billy O'Connor wrote:
    > ChrisC <> writes:
    >
    >
    >>how would I put a '\n' in say outfile.write( record, sizeof(record)).
    >>Thank you in advance for your help.

    >
    >
    > "\\n"


    Why "\\n"? Neither character of the string "\\n" is the character '\n'.
    Nobody said anything that implied a literal backslash (unless these
    are Perl-style single-quotes).
    Jeff Schwab, Feb 9, 2004
    #5
  6. ChrisC

    Rolf Magnus Guest

    Jonathan Turkanis wrote:

    > "Victor Bazarov" <> wrote in message
    > news:SfRVb.264899$na.421405@attbi_s04...
    >> "ChrisC" <> wrote...
    >> > how would I put a '\n' in say outfile.write( record,

    > sizeof(record)).
    >>
    >> What the hell do you mean? Do you mean, how to output a \n using
    >> ostream::write? That's simple:
    >>
    >> outfile.write("\n", 1);
    >>
    >> Since it's so simple, I doubt you're asking about that. So, what
    >> is this "put '\n' in say outfile.write ..."?

    >
    > Maybe he means this:
    >
    > outfile.write( record,
    > sizeof(record) );


    What does this has to do with '\n'?
    Rolf Magnus, Feb 9, 2004
    #6
  7. "Rolf Magnus" <> wrote in message
    news:c094l0$av1$02$-online.com...
    > Jonathan Turkanis wrote:
    >


    > >
    > > Maybe he means this:
    > >
    > > outfile.write( record,
    > > sizeof(record) );

    >
    > What does this has to do with '\n'?
    >


    The newline is after the comma. ;-)

    Jonathan
    Jonathan Turkanis, Feb 9, 2004
    #7
  8. ChrisC

    Mike Wahler Guest

    "Rolf Magnus" <> wrote in message
    news:c094l0$av1$02$-online.com...
    > Jonathan Turkanis wrote:
    >
    > > "Victor Bazarov" <> wrote in message
    > > news:SfRVb.264899$na.421405@attbi_s04...
    > >> "ChrisC" <> wrote...
    > >> > how would I put a '\n' in say outfile.write( record,

    > > sizeof(record)).
    > >>
    > >> What the hell do you mean? Do you mean, how to output a \n using
    > >> ostream::write? That's simple:
    > >>
    > >> outfile.write("\n", 1);
    > >>
    > >> Since it's so simple, I doubt you're asking about that. So, what
    > >> is this "put '\n' in say outfile.write ..."?

    > >
    > > Maybe he means this:
    > >
    > > outfile.write( record,
    > > sizeof(record) );

    >
    > What does this has to do with '\n'?


    It's a statment broken into two lines in the source (i.e. there's
    a newline character in the statment).

    I took this reply as sort of a 'joke'.

    -Mike
    Mike Wahler, Feb 10, 2004
    #8
  9. "Mike Wahler" <> wrote in message
    news:gAVVb.21729$...
    >
    > "Rolf Magnus" <> wrote in message
    > news:c094l0$av1$02$-online.com...
    > > Jonathan Turkanis wrote:


    > > >>
    > > >> What the hell do you mean? Do you mean, how to output a \n

    using
    > > >> ostream::write? That's simple:
    > > >>


    <snip>

    > > >
    > > > Maybe he means this:
    > > >
    > > > outfile.write( record,
    > > > sizeof(record) );

    > >
    > > What does this has to do with '\n'?

    >
    > It's a statment broken into two lines in the source (i.e. there's
    > a newline character in the statment).
    >
    > I took this reply as sort of a 'joke'.
    >


    Sorry you dont like my sense of humor. :-( .

    I was just having fun trying to figure out what the OP's question
    might be, since he didn't say what the types of outfile or record are,
    and there shouldn't be any problem writing a newline to any of the
    standard streams or stream buffers.

    Jonathan
    Jonathan Turkanis, Feb 10, 2004
    #9
  10. ChrisC

    Mike Wahler Guest

    "Jonathan Turkanis" <> wrote in message
    news:c099jv$14odsq$-berlin.de...
    >
    > "Mike Wahler" <> wrote in message
    > news:gAVVb.21729$...
    > >
    > > "Rolf Magnus" <> wrote in message
    > > news:c094l0$av1$02$-online.com...
    > > > Jonathan Turkanis wrote:

    >
    > > > >>
    > > > >> What the hell do you mean? Do you mean, how to output a \n

    > using
    > > > >> ostream::write? That's simple:
    > > > >>

    >
    > <snip>
    >
    > > > >
    > > > > Maybe he means this:
    > > > >
    > > > > outfile.write( record,
    > > > > sizeof(record) );
    > > >
    > > > What does this has to do with '\n'?

    > >
    > > It's a statment broken into two lines in the source (i.e. there's
    > > a newline character in the statment).
    > >
    > > I took this reply as sort of a 'joke'.
    > >

    >
    > Sorry you dont like my sense of humor. :-( .


    I didn't mean to indicate that. I did say I thought it was a joke.
    I like a joke as much as the next fellow, especially in a programming
    context.

    >
    > I was just having fun


    Of course, that's what I thought. :)

    >trying to figure out what the OP's question
    > might be, since he didn't say what the types of outfile or record are,
    > and there shouldn't be any problem writing a newline to any of the
    > standard streams or stream buffers.


    Yes, I sometimes approach an ambiguous post that way, and more
    often, the OT ones. :)

    -Mike
    Mike Wahler, Feb 10, 2004
    #10
  11. ChrisC

    Rolf Magnus Guest

    Jonathan Turkanis wrote:

    >
    > "Rolf Magnus" <> wrote in message
    > news:c094l0$av1$02$-online.com...
    >> Jonathan Turkanis wrote:
    >>

    >
    >> >
    >> > Maybe he means this:
    >> >
    >> > outfile.write( record,
    >> > sizeof(record) );

    >>
    >> What does this has to do with '\n'?
    >>

    >
    > The newline is after the comma. ;-)


    Ah. Sorry, I just missed that gag.
    Rolf Magnus, Feb 10, 2004
    #11
  12. ChrisC

    Rolf Magnus Guest

    Mike Wahler wrote:

    >> > I took this reply as sort of a 'joke'.
    >> >

    >>
    >> Sorry you dont like my sense of humor. :-( .

    >
    > I didn't mean to indicate that. I did say I thought it was a joke.


    Heh, you said "sort of a 'joke'", which doesn't sound too amused ;-)
    Rolf Magnus, Feb 10, 2004
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ChrisC
    Replies:
    2
    Views:
    419
    Thomas Matthews
    Feb 11, 2004
  2. Vernon Wenberg III
    Replies:
    4
    Views:
    230
    Tim Williams
    Oct 7, 2007
  3. KevinSimonson
    Replies:
    1
    Views:
    816
    Daniele Futtorovic
    Mar 13, 2011
  4. John
    Replies:
    2
    Views:
    96
    Michael Winter
    Nov 16, 2004
  5. alex
    Replies:
    3
    Views:
    530
    Richard Cornford
    Dec 28, 2006
Loading...

Share This Page