for and arrays

S

santosh

Keith said:
I don't understand. What is it about the Message-ID that causes you
to reach that conclusion?

Well, he is obviously using the newsreader 'trn' setup to masquerade as
OE, isn't he?
 
K

Keith Thompson

santosh said:
Well, he is obviously using the newsreader 'trn' setup to masquerade as
OE, isn't he?

It wasn't obvious to me; I never bothered to look at the headers.
 
B

Bill Cunningham

Mark,

I do have a program called indent. I can run all my source through that and
have a consistant scheme of code. Otherwise does this look better?

#include <stdio.h>

int main(void) {
int i;
for (i=0;i<7;i++) {
printf("%i",i);
printf(" ");
}
printf("\n");
return 0;
}

I think it's more rreadable. Is this what you suggested?

Bill
 
B

Bill Cunningham

Mark,

Well it took awhile and a lot of guessing and working with printf but I
finally got q3c.

#include <stdio.h>

int main(void) {
int i;
for (i=0;i<7;i++) {
printf("%i" " ",i);
}
printf("\n");
return 0;
}

How is the indentation on this one ?

Bill
 
K

Keith Thompson

Bill Cunningham said:
Mark,

Well it took awhile and a lot of guessing and working with printf but I
finally got q3c.

#include <stdio.h>

int main(void) {
int i;
for (i=0;i<7;i++) {
printf("%i" " ",i);
}
printf("\n");
return 0;
}

How is the indentation on this one ?

The indentation is mostly ok, but it's inconsistent. You're using 7
columns for the body of your function, but only 2 for the body of your
for loop. I suggest you consult the documentation of indent to find a
set of options that makes the levels consistent. My personal
recommendation is 4 columns for each level.

A comment on your code. Why did you write

"%i" " "

? Do you understand exactly what that syntax means (I'm referring to
the quotation marks, not the %i). Is there a simpler and clearer way
to say exactly the same thing? (Hint: Yes, there is.)
 
B

Bill Cunningham

A comment on your code. Why did you write

"%i" " "

? Do you understand exactly what that syntax means (I'm referring to
the quotation marks, not the %i).

Nope.

Is there a simpler and clearer way
to say exactly the same thing? (Hint: Yes, there is.)

I had no idea what I was doing. I was hoping I would get it right and
kept fiddling around with printfs' formatting til I got a space in between
each number. My text (not k&r2) said ' ' would be a space. It wasn't. I only
got number like such

'0''1''2'...

Bill
 
V

vippstar

It wasn't obvious to me; I never bothered to look at the headers.

Okay but now that it's been pointed out to you by someone, do you
still believe that Cunningham is genuine?
 
K

Keith Thompson

Okay but now that it's been pointed out to you by someone, do you
still believe that Cunningham is genuine?

I have no idea. For all I know, there could be perfectly valid
reasons to have trn masquerade (poorly) as OE. (I've done similar
things with web browsers in the past, telling Opera to masquerade as
Internet Explorer.) Or the Message-ID might have been set somewhere
else. Or his X-Newsreader: header might be incorrect. Or something I
haven't thought of.

Why would a troll post with trn masquerading as OE anyway? What would
be the point? Even if there's no innocent explanation, I don't see a
plausible guilty explanation. What do you have in mind?

Bill Cunningham: Do you have any comment on this? Do you know why
your X-Newsreader: header implies you're using Outlook Express, but
your Message-ID implies you're using trn?
 
V

vippstar

I have no idea. For all I know, there could be perfectly valid
reasons to have trn masquerade (poorly) as OE. (I've done similar
things with web browsers in the past, telling Opera to masquerade as
Internet Explorer.) Or the Message-ID might have been set somewhere
else. Or his X-Newsreader: header might be incorrect. Or something I
haven't thought of.

Why would a troll post with trn masquerading as OE anyway? What would
be the point? Even if there's no innocent explanation, I don't see a
plausible guilty explanation. What do you have in mind?

I can think of one: so that the troll can have an excuse for
constantly messing with the posts. (ie removing attributes, top-
posting, messing up quotes, stuff that Bill frequently does)
Why he doesn't genuinely use OE instead of "masquerading", I believe
because the troll does not use windows.
 
S

santosh

Keith said:
I have no idea. For all I know, there could be perfectly valid
reasons to have trn masquerade (poorly) as OE. (I've done similar
things with web browsers in the past, telling Opera to masquerade as
Internet Explorer.) Or the Message-ID might have been set somewhere
else. Or his X-Newsreader: header might be incorrect. Or something I
haven't thought of.

Why would a troll post with trn masquerading as OE anyway? What would
be the point? Even if there's no innocent explanation, I don't see a
plausible guilty explanation. What do you have in mind?

One thing I must note is that the string "...@trnddc" is found only in
conjunction with Microsoft Outlook Express; I did a quick Google Groups
search. However only a minute fraction of posts from OE seem to have
this form msg-ID in the first place.

It still seems suspicious to me, but I may be making accusations without
clear evidence. In any case, regardless of the "msg-ID" issue, based on
an overall consideration of his posts to clc, I believe Bill C is a
troll. IMO of course.

<snip>
 
M

Mark L Pappin

Bill Cunningham said:

The line Keith quotes contains two string literals, "%i" and " ",
separated by nothing but whitespace ("%i"" " or "%i" " " would be
equivalent). The compiler has (as it is required to) merged them into
a single string literal "%i " and it is this which printf() was
passed.
I had no idea what I was doing. I was hoping I would get it right
and kept fiddling around

You've been told before: Don't Do That.
If you have no idea, ask.

I'm beginning to realise how pointless my offer to help was, but I'm
the eternal optimist here: prove them wrong, Bill; work through the
exercises I've set, post the code you come up with, tell us where
you're stuck, absorb the help that's given to you, and practice,
practice, practice. But step back from the Monte Carlo programming
technique (by which I mean "throwing random characters into source
file and hoping it does what you want") that you've already discovered
many times DOES NOT WORK.
My text (not k&r2)

1. What is your text?
2. Get K&R2.
said ' ' would be a space. It wasn't.

You seem to be using English the same way you use C, stringing
together words that individually are fine but in concert are
meaningless. ' ' most certainly _is_ a space, but the way in which
you used it obviously didn't produce a space in the output - what you
should do in this case is

1. Show us the code you wrote.
2. Tell us _precisely_ what you expected it to do.
3. Tell us _precisely_ what it actually did.

mlp
 
B

Barry Schwarz

Okay but now that it's been pointed out to you by someone, do you
still believe that Cunningham is genuine?

I don't understand headers for the most part but after BC's recent new
percentage thread and his response to RH in the q3 tutorial thread, I
have reluctantly come to the same conclusion. Even worse, the quality
of his trolling is decreasing (almost as if he were losing interest in
stringing us along).

But it does give me a chance to test a filter feature of Agent to kill
any thread he starts.
 
B

Bill Cunningham

Bill Cunningham: Do you have any comment on this? Do you know why
your X-Newsreader: header implies you're using Outlook Express, but
your Message-ID implies you're using trn?
Keith I don't think my headers are lying. I'm running old ver 6 of OE.
slrn didn't work out for me. All the newsreaders I've tried as late I
haven't been able to lock onto my news server with.
I don't use trn at all.

Bill
 
B

Bill Cunningham

Mark L Pappin said:
The line Keith quotes contains two string literals, "%i" and " ",
separated by nothing but whitespace ("%i"" " or "%i" " " would be
equivalent). The compiler has (as it is required to) merged them into
a single string literal "%i " and it is this which printf() was
passed.


You've been told before: Don't Do That.
If you have no idea, ask.

I'm beginning to realise how pointless my offer to help was, but I'm
the eternal optimist here: prove them wrong, Bill; work through the
exercises I've set, post the code you come up with, tell us where
you're stuck, absorb the help that's given to you, and practice,
practice, practice. But step back from the Monte Carlo programming
technique (by which I mean "throwing random characters into source
file and hoping it does what you want") that you've already discovered
many times DOES NOT WORK.


1. What is your text?
2. Get K&R2.


You seem to be using English the same way you use C, stringing
together words that individually are fine but in concert are
meaningless. ' ' most certainly _is_ a space, but the way in which
you used it obviously didn't produce a space in the output - what you
should do in this case is

1. Show us the code you wrote.
2. Tell us _precisely_ what you expected it to do.
3. Tell us _precisely_ what it actually did.

mlp

These questions in your tutorial Mark is indeed getting more difficult.
It may be several days before I can put together all the answers to all the
questions but I sill go one step at a time. I hope you are prepared to work
with me on some of these, the first answer will quite probably not be
correct. But what ever happens I certainly thank you for your attempts. I
will do my best on this.

Bill
 
B

Bill Cunningham

Bill Cunningham: Do you have any comment on this? Do you know why
your X-Newsreader: header implies you're using Outlook Express, but
your Message-ID implies you're using trn?

I will post my headers.

Path:
nwrddc01.gnilink.net!cyclone2.gnilink.net!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc04.POSTED!12222bec!not-for-mail
From: "Bill Cunningham" <[email protected]>
Newsgroups: comp.lang.c
References: <s_shk.374$5Q.80@trnddc06> <[email protected]>
<prthk.376$5Q.164@trnddc06> <[email protected]>
<foNhk.417$_l.339@trnddc04> <[email protected]>
<Va5ik.507$_l.500@trnddc04> <[email protected]>
<[email protected]> <s15jk.160$wS4.87@trnddc03>
<[email protected]> <[email protected]>
<[email protected]> <[email protected]>
<[email protected]>
<[email protected]> <[email protected]>
<[email protected]> <[email protected]>
<cdea9ab6-0b58-45f7-b23f-9faf62a8a02d@i76g2000hsf.googlegroups.com>
<[email protected]>
Subject: Re: for and arrays
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
Message-ID: <JM2kk.567$rb5.516@trnddc04>
Date: Wed, 30 Jul 2008 18:53:29 GMT
NNTP-Posting-Host: 71.188.198.61
X-Trace: trnddc04 1217444009 71.188.198.61 (Wed, 30 Jul 2008 14:53:29 EDT)
NNTP-Posting-Date: Wed, 30 Jul 2008 14:53:29 EDT
Xref: news.verizon.net comp.lang.c:498498
X-Received-Date: Wed, 30 Jul 2008 14:53:28 EDT (nwrddc01.gnilink.net)
 
B

Bill Cunningham

Well, I'm sorry for my accusations,

No problem.

but forgive me if I'm not as
enthusiastic about discussing C with you as I was some weeks
previously. In any case you are still getting excellent help from
several posters.

I think that's vippstar's job.

Bill
 
B

Bill Cunningham

santosh said:
Well, I'm sorry for my accusations, but forgive me if I'm not as
enthusiastic about discussing C with you as I was some weeks
previously. In any case you are still getting excellent help from
several posters.

Vippstar only comes out to produce problems. Almost troll like. But I
thank you for your help. You do discuss C atleast. I have posted my full
headers as a measure of good faith.

Bill
 
S

santosh

Bill said:
Vippstar only comes out to produce problems. Almost troll like.
But I
thank you for your help. You do discuss C atleast. I have posted my
full headers as a measure of good faith.

Bill, you are getting better help from Mark Pappin than one could
reasonably hope for. Just stick to his tutorial, however long it takes
to answer his exercises. Even a partial attempt at a solution is better
than endless debates with formatting issues and such.
 
B

Bill Cunningham

Mark L Pappin said:
The line Keith quotes contains two string literals, "%i" and " ",
separated by nothing but whitespace ("%i"" " or "%i" " " would be
equivalent). The compiler has (as it is required to) merged them into
a single string literal "%i " and it is this which printf() was
passed.

[snip]

Mark,

I was thinking that the conversion specifiers and string literals are always
separated by a comma,

printf("%i"," ");

Was what I was think and , was printed. That further confused me. My text is
an O'reilly pocket referecne simply called "C" and as O'reilly books are
there is an animal on the front promenantly a cow. Above is the code I kept
trying. The comma between the 2 string literals.

Bill
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top