for and arrays

M

Mabden

CBFalconer said:
Read the docs that came with it.

What about the rest of us. I'm not loading that program, I have no help
file. Now I want to know! Don't be an info-hog.

I don't really understand a post that basically says, "I know what you are
asking, and I could tell you the answer, but just go **** yourself, because
I've had to Google it for 12 seconds, and you should too! Otherwise you
might not have the Google skills I've built up - you young bucks today, why
I oughtta... <grumble>"

Help or STFU. Why post, "I'm not telling!" ?!! Just don't post. Why say,
"I'm going to be a dick, Here's how..."?
 
S

santosh

Bill said:
Oh my goodness no. The carets look like exponents. That's about
all I get.

Okay, let's start smaller. Do you understand this?

printf("number = %i", n);

Try the following questions.

1.) How many arguments does this call have? Explain your answer.
2.) How many arguments does printf expect? Consult your Ref. for this.
3.) What does this printf call do?
 
S

santosh

Mabden said:
What about the rest of us. I'm not loading that program, I have no
help file. Now I want to know! Don't be an info-hog.

<rest snipped>

That response by CBFalconer was, I'm pretty sure, specifically tailored
for Bill Cunningham, who has a habit of repeatedly asking trivial
questions even after they have been answered multiple times, and not
bothering to consult his system documentation.

Besides usage of 'indent' is not topical here. It may be topical in
gnu.misc.discuss or gnu.utils.help (if it is GNU indent) or
comp.unix.misc or comp.programming.
 
V

vippstar

<rest snipped>

That response by CBFalconer was, I'm pretty sure, specifically tailored
for Bill Cunningham, who has a habit of repeatedly asking trivial
questions even after they have been answered multiple times, and not
bothering to consult his system documentation.

Besides usage of 'indent' is not topical here. It may be topical in
gnu.misc.discuss or gnu.utils.help (if it is GNU indent) or
comp.unix.misc or comp.programming.


Mabden is a troll... please don't reply to him (and other trolls)
 
K

Keith Thompson

Bill Cunningham said:
Well yeah I understand what that does above but the way it was put it
have to be on the same line.

They have to be on the same *output* line, not necessarily on the same
line in your program.

This:

printf("Hello, ");
printf("world\n");

is two lines in a program; it produces a single line of output.
 
B

Bill Cunningham

Bill, the first parameter in printf is a string. Every character in it
will be printed unless it is an escape sequence or a format
placeholder (i.e. %i, which is for printing an integer). So, the %i is
not being printed, it will print i (the second argument) as an
integer. As for \t, that is a escape sequence which stands for the TAB
character.

Will the = be printed ? I understand the first parameter passed to
printf is a string. But I keep thinking that everything in quotes is
printed except what begins with %.

Bill
 
S

santosh

Mabden is a troll... please don't reply to him (and other trolls)

Okay, I'll take your word for it, since these are the first posts to
this group by 'Mabden' that I'm noticing.
 
B

Bill Cunningham

Okay, let's start smaller. Do you understand this?

printf("number = %i", n);

Try the following questions.

1.) How many arguments does this call have? Explain your answer.
2.) How many arguments does printf expect? Consult your Ref. for this.
3.) What does this printf call do?

Sure I understand that one. number= and the value of n will be printed.
Yes that's easy.
There's an ... elipses in the parameter. I think that might mean several
arguments.

Bill
 
A

Antoninus Twink

I don't really understand a post that basically says, "I know what you are
asking, and I could tell you the answer, but just go **** yourself, because
I've had to Google it for 12 seconds, and you should too! Otherwise you
might not have the Google skills I've built up - you young bucks today, why
I oughtta... <grumble>"

Help or STFU. Why post, "I'm not telling!" ?!! Just don't post. Why say,
"I'm going to be a dick, Here's how..."?

Welcome to the world of CBFalconer.


FYI:

-kr, --k-and-r-style Use Kernighan & Ritchie coding style.

The Kernighan & Ritchie style is used throughout their well-known book
"The C Programming Language". It is enabled with the ‘-kr’ option.

The Kernighan & Ritchie style corresponds to the following set of
options:

-bap Force blank lines after procedure bodies.
-bbo Prefer to break long lines before boolean operators.
-br Put braces on line with if, etc.
-brs Put braces on struct declaration line.
-c33 Put comments to the right of code in column 33.
-cd33 Put comments to the right of the declarations in column 33.
-ce Cuddle else and preceding ‘}’.
-ci4 Continuation indent of 4 spaces.
-cli0 Case label indent of 0 spaces.
-cp33 Put comments to the right of #else and #endif statements in column 33.
-cs Put a space after a cast operator.
-d0 Set indentation of comments not to the right of code to 0 spaces.
-di1 Put variables in column 1.
-hnl Prefer to break long lines at the position of newlines in the input.
-i4 Set indentation level to 4 spaces.
-ip0 Indent parameter types in old-style function definitions by 0 spaces.
-l75 Set maximum line length for non-comment lines to 75.
-lp Line up continued lines at parentheses.
-nbad Do not force blank lines after declarations.
-nbc Do not force newlines after commas in declarations.
-ncdb Do not put comment delimiters on blank lines.
-nfc1 Do not format comments in the first column as normal.
-nfca Do not format any comments.
-npcs Do not put space after the function in function calls.
-nprs Do not put a space after every ’(’ and before every ’)’.
-npsl Put the type of a procedure on the same line as its name.
-nsc Do not put the ‘*’ character at the left of comments.
-nsob Do not swallow optional blank lines.
-nss Do not force a space before the semicolon after certain statements.
-saf Put a space after each for.
-sai Put a space after each if.
-saw Put a space after each while.
 
B

Bill Cunningham

Mabden said:
What about the rest of us. I'm not loading that program, I have no help
file. Now I want to know! Don't be an info-hog.

I don't really understand a post that basically says, "I know what you are
asking, and I could tell you the answer, but just go **** yourself,
because
I've had to Google it for 12 seconds, and you should too! Otherwise you
might not have the Google skills I've built up - you young bucks today,
why
I oughtta... <grumble>"

Help or STFU. Why post, "I'm not telling!" ?!! Just don't post. Why say,
"I'm going to be a dick, Here's how..."?

kernighan and ritchie style. The best there is.

Bill
 
K

Keith Thompson

...


Will some code beautifiers be better?

Do you mean better than "indent -kr"? Better in what sense?

If I undrestand your question correctly, there is no definitive answer
to it -- and if there were, I doubt that it would be topical here.
 
D

Default User

Richard said:
Frankly, I don't see that it matters whether he is a troll, or someone
with a learning problem and the accompanying bad attitude that means
he refuses to do something about his learning problem. Either way,
trying to help him is bad for both the newsgroup and Bill himself.

This is kind of where I am with it. Either he's trolling or
legitimately learning disabled. He either is pretending not to learn
anything, or incable of learning. So it's a waste of time to pursue
this.

He's supposedly been learning C for YEARS. And no farther along than
this. You'd except an average student to show more progress after a few
weeks of study than Bill demonstrates.




Brian
 
B

Bartc

[indent -kr]
What's more, it's pretty easy to *guess* what -kr would do, isn't it? For
example, I didn't know, but I guessed, and then I looked it up, and I
discovered that my guess was correct.

'kernighan-and-ritchie' style, for those who couldn't guess and didn't have
five minutes to waste on google.
 
B

Barry Schwarz

snip
#include <stdio.h>
#include <stdlib.h>

#define MAX_LOOP 7

int main(void)
{
int i;

for(i=0;i<MAX_LOOP;i++)
{
if(i==MAX_LOOP)

You have some reason to believe this if can ever evaluate to true?
 
K

Keith Thompson

Bill Cunningham said:
Bill, the first parameter in printf is a string. Every character in it
will be printed unless it is an escape sequence or a format
placeholder (i.e. %i, which is for printing an integer). So, the %i is
not being printed, it will print i (the second argument) as an
integer. As for \t, that is a escape sequence which stands for the TAB
character.

Will the = be printed ? I understand the first parameter passed to
printf is a string. But I keep thinking that everything in quotes is
printed except what begins with %.

Bill:

I have said this at least twice before. I will say it again. Please
do not ignore it this time.

Usually, when you post here, quoted material is correctly attributed
and preceded with the usual "> " prefix. Sometimes, such as in the
article to which I'm now replying, quoted material is not visibly
distinguished from new material, which makes it difficult to figure
out who said what.

Whatever you did when you posted that followup, please *stop doing
it*.
 
K

Keith Thompson

Mabden said:
What about the rest of us. I'm not loading that program, I have no help
file. Now I want to know! Don't be an info-hog.

I don't really understand a post that basically says, "I know what you are
asking, and I could tell you the answer, but just go **** yourself, because
I've had to Google it for 12 seconds, and you should too! Otherwise you
might not have the Google skills I've built up - you young bucks today, why
I oughtta... <grumble>"

Help or STFU. Why post, "I'm not telling!" ?!! Just don't post. Why say,
"I'm going to be a dick, Here's how..."?

Chuck's response, like mine, was directed to the person who asked the
question, Bill Cunningham. Bill clearly has already installed indent,
since he's been using it. Therefore he already has the documentation,
and doesn't need to ask what "-kr" does.

Yes, explaining what "indent -kr" does might provide useful
information to others, but we both thought it was more important to
make the point that the way to find out what a particular tool does is
to try it, or better yet to consult that tool's documentation.

By the way, I see that you've returned after a long absence. You were
not missed. Your act, in which you've apparently decided to pretend
to be a jerk, was never amusing, and it's not amusing now. There's no
real difference between pretending to be a jerk and actually being
one. If you choose to act like a jerk, you'll be treated as one --
i.e., ignored. (Feel free to replace "jerk" with a stronger epithet
if you like.)

I believe you're capable of being far more reasonable, and of making
actual contributions to this group if you choose to do so.

(Some of my assumptions here are based on information from outside
this newsgroup, which I won't discuss here further.)
 
D

Default User

Keith said:
"Bill Cunningham" <[email protected]> writes:
I have said this at least twice before. I will say it again. Please
do not ignore it this time.

Usually, when you post here, quoted material is correctly attributed
and preceded with the usual "> " prefix. Sometimes, such as in the
article to which I'm now replying, quoted material is not visibly
distinguished from new material, which makes it difficult to figure
out who said what.

That's the Google Groups/Outlook Express tag-team nonsense. Nigel's
post from GG has the header line:

Content-Transfer-Encoding: quoted-printable

OE has a problem with that, and quotes don't come out right. An easy
way for most to fix this (short of dumping OE) is to download and
install OE Quotefix. I say easy for most, but we are talking about Bill
here.




Brian
 
S

santosh

Richard said:
santosh said:


You're fairly new, though, right?

By Usenet standards, yes. It's about five years now since I discovered
this group and about three since I started posting here.
He's been around before.

Must have been absent for at least a few years, or I'd have remembered
the nick.
 

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,772
Messages
2,569,593
Members
45,113
Latest member
Vinay KumarNevatia
Top