473,770 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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*******@nospa m.yahoo.co.uk
Jul 22 '05 #1
11 2535
"ChrisC" <ch*******@nosp am.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.********@com Acast.net> wrote in message
news:SfRVb.2648 99$na.421405@at tbi_s04...
"ChrisC" <ch*******@nosp am.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*******@nosp am.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*******@nosp am.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.********@com Acast.net> wrote in message
news:SfRVb.2648 99$na.421405@at tbi_s04...
"ChrisC" <ch*******@nosp am.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.********@com Acast.net> wrote in message
news:SfRVb.2648 99$na.421405@at tbi_s04...
"ChrisC" <ch*******@nosp am.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******@mkwah ler.net> wrote in message
news:gA******** **********@news read1.news.pas. earthlink.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******@kanga roologic.com> wrote in message
news:c0******** *****@ID-216073.news.uni-berlin.de...

"Mike Wahler" <mk******@mkwah ler.net> wrote in message
news:gA******** **********@news read1.news.pas. earthlink.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

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

Similar topics

11
1787
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) + x/2. + 3. This is not really correct because the assert statement is supposed to validate the logical consistency of the program itself, not the input data. So, for example, when you compile with optimization on, assert
28
3596
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 very early draft for a new "assert" syntax: This was inspired in Ruby's assert syntax. I'm not familiar with Ruby at all, so the chances are that this piece of code is broken, but I think the idea is very obvious. In Ruby, assert is simply a...
1
2113
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 understand that now and it seems to be fixed but the data I'm pulling from the HTML fields is not being appended correctly do my Access DB....The field in the DB now reads " ' ". I understand why it does that (my function) but what I need it to read is...
2
437
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
2274
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 an `correct' return value when the argument `Num' is larger than or equal to the Macro `NUM_SYS'. If the argument is less than the Macro, the function without a `return' get an undefined value. I've made a test on Ms Windows 2000 and VC 6.
13
2575
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(){}, my_meth2: function(){} }); to define new methods on the MyObj prototype object. Object.extend
6
2685
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 learn/try a full blown parsing module. My simple script works well until it runs into functions that straddle multiple lines. For example: Call mass_write(&H0, &HF, &H4, &H0, &H5, &H0, &H6, &H0, &H7, &H0, &H8, &H0, _
18
7975
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 defintion of "expression" and "statement"? What is the difference between an expression and a statement?
2
6588
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; boolean boost;
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10259
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.