nextline statement in write function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ChrisC

    nextline statement in write function

    how would I put a '\n' in say outfile.write( record, sizeof(record)) .
    Thank you in advance for your help.
    --
    ChrisC - chrispche@nospa m.yahoo.co.uk
  • Victor Bazarov

    #2
    Re: nextline statement in write function

    "ChrisC" <chrispche@nosp am.yahoo.co.uk> wrote...[color=blue]
    > how would I put a '\n' in say outfile.write( record, sizeof(record)) .[/color]

    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


    Comment

    • Jonathan Turkanis

      #3
      Re: nextline statement in write function

      "Victor Bazarov" <v.Abazarov@com Acast.net> wrote in message
      news:SfRVb.2648 99$na.421405@at tbi_s04...[color=blue]
      > "ChrisC" <chrispche@nosp am.yahoo.co.uk> wrote...[color=green]
      > > how would I put a '\n' in say outfile.write( record,[/color][/color]
      sizeof(record)) .[color=blue]
      >
      > 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 ..."?[/color]

      Maybe he means this:

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

      Jonathan



      Comment

      • Billy O'Connor

        #4
        Re: nextline statement in write function

        ChrisC <chrispche@nosp am.yahoo.co.uk> writes:
        [color=blue]
        > how would I put a '\n' in say outfile.write( record, sizeof(record)) .
        > Thank you in advance for your help.[/color]

        "\\n"

        Comment

        • Jeff Schwab

          #5
          Re: nextline statement in write function

          Billy O'Connor wrote:[color=blue]
          > ChrisC <chrispche@nosp am.yahoo.co.uk> writes:
          >
          >[color=green]
          >>how would I put a '\n' in say outfile.write( record, sizeof(record)) .
          >>Thank you in advance for your help.[/color]
          >
          >
          > "\\n"[/color]

          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).

          Comment

          • Rolf Magnus

            #6
            Re: nextline statement in write function

            Jonathan Turkanis wrote:
            [color=blue]
            > "Victor Bazarov" <v.Abazarov@com Acast.net> wrote in message
            > news:SfRVb.2648 99$na.421405@at tbi_s04...[color=green]
            >> "ChrisC" <chrispche@nosp am.yahoo.co.uk> wrote...[color=darkred]
            >> > how would I put a '\n' in say outfile.write( record,[/color][/color]
            > sizeof(record)) .[color=green]
            >>
            >> 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 ..."?[/color]
            >
            > Maybe he means this:
            >
            > outfile.write( record,
            > sizeof(record) );[/color]

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

            Comment

            • Jonathan Turkanis

              #7
              Re: nextline statement in write function


              "Rolf Magnus" <ramagnus@t-online.de> wrote in message
              news:c094l0$av1 $02$1@news.t-online.com...[color=blue]
              > Jonathan Turkanis wrote:
              >[/color]
              [color=blue][color=green]
              > >
              > > Maybe he means this:
              > >
              > > outfile.write( record,
              > > sizeof(record) );[/color]
              >
              > What does this has to do with '\n'?
              >[/color]

              The newline is after the comma. ;-)

              Jonathan



              Comment

              • Mike Wahler

                #8
                Re: nextline statement in write function


                "Rolf Magnus" <ramagnus@t-online.de> wrote in message
                news:c094l0$av1 $02$1@news.t-online.com...[color=blue]
                > Jonathan Turkanis wrote:
                >[color=green]
                > > "Victor Bazarov" <v.Abazarov@com Acast.net> wrote in message
                > > news:SfRVb.2648 99$na.421405@at tbi_s04...[color=darkred]
                > >> "ChrisC" <chrispche@nosp am.yahoo.co.uk> wrote...
                > >> > how would I put a '\n' in say outfile.write( record,[/color]
                > > sizeof(record)) .[color=darkred]
                > >>
                > >> 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 ..."?[/color]
                > >
                > > Maybe he means this:
                > >
                > > outfile.write( record,
                > > sizeof(record) );[/color]
                >
                > What does this has to do with '\n'?[/color]

                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


                Comment

                • Jonathan Turkanis

                  #9
                  Re: nextline statement in write function


                  "Mike Wahler" <mkwahler@mkwah ler.net> wrote in message
                  news:gAVVb.2172 9$uM2.7376@news read1.news.pas. earthlink.net.. .[color=blue]
                  >
                  > "Rolf Magnus" <ramagnus@t-online.de> wrote in message
                  > news:c094l0$av1 $02$1@news.t-online.com...[color=green]
                  > > Jonathan Turkanis wrote:[/color][/color]
                  [color=blue][color=green][color=darkred]
                  > > >>
                  > > >> What the hell do you mean? Do you mean, how to output a \n[/color][/color][/color]
                  using[color=blue][color=green][color=darkred]
                  > > >> ostream::write? That's simple:
                  > > >>[/color][/color][/color]

                  <snip>
                  [color=blue][color=green][color=darkred]
                  > > >
                  > > > Maybe he means this:
                  > > >
                  > > > outfile.write( record,
                  > > > sizeof(record) );[/color]
                  > >
                  > > What does this has to do with '\n'?[/color]
                  >
                  > 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'.
                  >[/color]

                  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


                  Comment

                  • Mike Wahler

                    #10
                    Re: nextline statement in write function


                    "Jonathan Turkanis" <technews@kanga roologic.com> wrote in message
                    news:c099jv$14o dsq$1@ID-216073.news.uni-berlin.de...[color=blue]
                    >
                    > "Mike Wahler" <mkwahler@mkwah ler.net> wrote in message
                    > news:gAVVb.2172 9$uM2.7376@news read1.news.pas. earthlink.net.. .[color=green]
                    > >
                    > > "Rolf Magnus" <ramagnus@t-online.de> wrote in message
                    > > news:c094l0$av1 $02$1@news.t-online.com...[color=darkred]
                    > > > Jonathan Turkanis wrote:[/color][/color]
                    >[color=green][color=darkred]
                    > > > >>
                    > > > >> What the hell do you mean? Do you mean, how to output a \n[/color][/color]
                    > using[color=green][color=darkred]
                    > > > >> ostream::write? That's simple:
                    > > > >>[/color][/color]
                    >
                    > <snip>
                    >[color=green][color=darkred]
                    > > > >
                    > > > > Maybe he means this:
                    > > > >
                    > > > > outfile.write( record,
                    > > > > sizeof(record) );
                    > > >
                    > > > What does this has to do with '\n'?[/color]
                    > >
                    > > 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'.
                    > >[/color]
                    >
                    > Sorry you dont like my sense of humor. :-( .[/color]

                    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.
                    [color=blue]
                    >
                    > I was just having fun[/color]

                    Of course, that's what I thought. :-)
                    [color=blue]
                    >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.[/color]

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

                    -Mike


                    Comment

                    • Rolf Magnus

                      #11
                      Re: nextline statement in write function

                      Jonathan Turkanis wrote:
                      [color=blue]
                      >
                      > "Rolf Magnus" <ramagnus@t-online.de> wrote in message
                      > news:c094l0$av1 $02$1@news.t-online.com...[color=green]
                      >> Jonathan Turkanis wrote:
                      >>[/color]
                      >[color=green][color=darkred]
                      >> >
                      >> > Maybe he means this:
                      >> >
                      >> > outfile.write( record,
                      >> > sizeof(record) );[/color]
                      >>
                      >> What does this has to do with '\n'?
                      >>[/color]
                      >
                      > The newline is after the comma. ;-)[/color]

                      Ah. Sorry, I just missed that gag.

                      Comment

                      • Rolf Magnus

                        #12
                        Re: nextline statement in write function

                        Mike Wahler wrote:
                        [color=blue][color=green][color=darkred]
                        >> > I took this reply as sort of a 'joke'.
                        >> >[/color]
                        >>
                        >> Sorry you dont like my sense of humor. :-( .[/color]
                        >
                        > I didn't mean to indicate that. I did say I thought it was a joke.[/color]

                        Heh, you said "sort of a 'joke'", which doesn't sound too amused ;-)

                        Comment

                        Working...