473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 - ch*******@nospam.yahoo.co.uk
Jul 22 '05 #1
11 2470
"ChrisC" <ch*******@nospam.yahoo.co.uk> 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
Jul 22 '05 #2
"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:SfRVb.264899$na.421405@attbi_s04...
"ChrisC" <ch*******@nospam.yahoo.co.uk> 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

Jul 22 '05 #3
ChrisC <ch*******@nospam.yahoo.co.uk> writes:
how would I put a '\n' in say outfile.write( record, sizeof(record)).
Thank you in advance for your help.


"\\n"
Jul 22 '05 #4
Billy O'Connor wrote:
ChrisC <ch*******@nospam.yahoo.co.uk> 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).

Jul 22 '05 #5
Jonathan Turkanis wrote:
"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:SfRVb.264899$na.421405@attbi_s04...
"ChrisC" <ch*******@nospam.yahoo.co.uk> 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'?

Jul 22 '05 #6

"Rolf Magnus" <ra******@t-online.de> wrote in message
news:c0*************@news.t-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

Jul 22 '05 #7

"Rolf Magnus" <ra******@t-online.de> wrote in message
news:c0*************@news.t-online.com...
Jonathan Turkanis wrote:
"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:SfRVb.264899$na.421405@attbi_s04...
"ChrisC" <ch*******@nospam.yahoo.co.uk> 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
Jul 22 '05 #8

"Mike Wahler" <mk******@mkwahler.net> wrote in message
news:gA******************@newsread1.news.pas.earth link.net...

"Rolf Magnus" <ra******@t-online.de> wrote in message
news:c0*************@news.t-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
Jul 22 '05 #9

"Jonathan Turkanis" <te******@kangaroologic.com> wrote in message
news:c0*************@ID-216073.news.uni-berlin.de...

"Mike Wahler" <mk******@mkwahler.net> wrote in message
news:gA******************@newsread1.news.pas.earth link.net...

"Rolf Magnus" <ra******@t-online.de> wrote in message
news:c0*************@news.t-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
Jul 22 '05 #10
Jonathan Turkanis wrote:

"Rolf Magnus" <ra******@t-online.de> wrote in message
news:c0*************@news.t-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.

Jul 22 '05 #11
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 ;-)

Jul 22 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Paul Rubin | last post by:
I frequently find myself writing stuff like # compute frob function, x has to be nonnegative x = read_input_data() assert x >= 0, x # mis-use of "assert" statement frob = sqrt(x)...
28
by: Fábio Mendes | last post by:
I'm sorry if it's an replicate. Either my e-mail program is messing with things or the python-list sent my msg to /dev/null. I couldn't find anything related in previous PEP's, so here it goes a...
1
by: dmiller23462 | last post by:
Hey guys.... I put an error-handling in my page and have it posted at the complete end of the code, see below(when people were putting in 's I was getting the delimiter errors). Great, I...
2
by: ChrisC | last post by:
if I had outfile.write((char*) record, sizeof( record )) how would I get write to return a newline? as it is it doesn't. -- ChrisC - chrispche@nospam.yahoo.co.uk
6
by: lovecreatesbeauty | last post by:
I ever missed a `return' statement when write a function `int HighDigit(Num)' to get the highest digit of an integer. But even if the `return' statement is ignored the function still can obtain...
13
by: eman1000 | last post by:
I was recently looking at the prototype library (http://prototype.conio.net/) and I noticed the author used the following syntax: Object.extend(MyObj.prototype, { my_meth1: function(){},...
6
by: Jacob Rael | last post by:
Hello, I have a simple script to parse a text file (a visual basic program) and convert key parts to tcl. Since I am only working on specific sections and I need it quick, I decided not to...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
2
by: milk242 | last post by:
import java.util.Scanner; public class DogDemo { public static void main(String args) { Dog myDog = new Dog; Scanner keyboard = new Scanner(System.in); String name, breed; int age;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.