C
CBFalconer
Mark said:.... snip ...
Who is Jane? Your mother? Your wife?
All he is proving is that he has watched SNL from the 70s, and
picked up the rudest and most ignorant phrases therefrom.
Mark said:.... snip ...
Who is Jane? Your mother? Your wife?
Mark said:Actually, that was 'my' poor attempt at being funny
But feel free to kick in with a post that actually contributes
something to the discussion Eric. You are one of the
brighter posters on CLC and I'd hate for you to limit your
response to: 'poor kid can't even google.'
Mark said:Before arguing with CLC regulars, check the Standard.
Nope, its implementation defined.
Eric Sosman said:Well, I gave a citation from the Standard. You're choosing
to impose some sort of contorted Topsy-Turvy-Land mis-reading,
and I can't rescue you from your folly. What's left besides
innocent merriment?
"Contorted Topsy-Turvy-Land mis-reading"???
Once again, my interpretation of the citation in question is:
a line is required to contain a terminating new-line unless it happens
to be the last line, in which case it is implementation defined as to
whether or not a new-line is required.
Please, enlighten me... what am I mis-reading?
pete said:If a newline character is required,
then a partial line isn't a line.
Line semantics wouldn't apply to partial lines.
I've stated as much earlier in the thread... but that is irrelevant.
As you know, fflush() doesn't deal with lines, it deals with unwritten
'data'.
Line semantics aren't the issue. The purpose of fflush() is to deliver the
unwritten data to the host environment, no?
The question amounts to: is fflush() enough to 'portably' ensure that
any unwritten data is delivered to the host environment.
Indeed. But sometimes "text files" (including stdout) require "lines".
Yes, but some host environments are mean, nasty, and rotten.
IBM mainframes in particular tend to be like this.
If you write a "partial line" and fflush() it, nothing comes out!
(They sometimes put a special hack into the stdin-reading code, so
that if you do:
fputs("some prompt: ", stdout);
fflush(stdout);
result = fgets(line, sizeof line, stdin);
the fgets() outputs an extra newline, so that the prompt appears.
But sometimes even that does not happen.)
It gets "delivered" all right, but the mean nasty host does not pass
it on to the user.
Obnoxious, no? But it happens. It is safer to end your last output
line with a newline. This also prevents the output line from being
overwritten by mean, nasty, rotten Unix-clone shells.
No. Whether the last line _requires_ a newline is implementation
defined.
Doesn't that render the implementation 'non-conforming'?
It is safer to end your last output
Agreed. (Safer) But the real question is portability...
Doesn't that render the implementation 'non-conforming'?
Agreed. (Safer) But the real question is portability...
I've mentioned upwards in the thread that it's possible that output
may not be visible for a number of other reasons (such as a terminal
window being closed immediately following program termination, in
which case a new-line won't help) but does the exclusion of a final
new-line written to a text stream make the program 'non-portable'?
without including a final newline]Let's forget about terminals for a second... consider the following
trivial utility [code snipped, but it writes to the file "last.run",
Does the lack of a new-line prevent this code from being portable?
Is it or is it not a strictly conforming program?
HI to all why to use format specifier %s and %c whatever it may be/* E-mail.c */
#define User "Yu.Song"
#define At '@'
#define Warwick "warwick.ac.uk"
int main() {
printf("Yu Song's E-mail: %s%c%s", User, At, Warwick);
return 0;}
junaid said:HI to all why to use format specifier %s and %c whatever it may be
printf("Yu Song's E-mail:"User At Warwick);
This Will Work fine after all User,At,Warwick are the macros and
releted to preprocessor tasks not a variable.
Post this to a "specific platform" newsgroup (e.g. Linux, Windows)
28 replies about someone's signature and only one actually answering the
original question. What a newsgroup!
That means we have an eye, which captures even minute things about the
C language, whether it's an intentionally posted question or
someone's signature.
If someone's signatures gives 28 people to talk on technical topics
what's wrong with it? And the plus point is the newcomer like me gets
knowledge from it.
and very interesting discussion about '\n' is not an excuse
of the main question.provide me with an exe of such a program?
Le 13/06/2005 23:40, dans
(e-mail address removed), « junaid »
Still, nobody has given a clue on the original question... Sad.
I also applogise for the mistake that I have made (not all the
remaining 28 posts are technical some of them are simply personal)and
we also wasting our time (I think)on a nontechnical things.
I am sorry if I have hurted you
but What I mean from my earlier post is
we dont have to miss the chance to learn something new
I dont care if
it comes from someones signature ,but if the disscussion is going to be
personal it must be stoped.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.