By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,598 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,598 IT Pros & Developers. It's quick & easy.

what exactly does the operator |= ???

P: n/a
hello!!

I was looking at some code in C... and saw this "exotic" operator |=.

first time with it, what exactky does???

thanks in advance.
Erick->

Nov 16 '06 #1
Share this Question
Share on Google+
37 Replies


P: n/a
Erick-said:
hello!!

I was looking at some code in C... and saw this "exotic" operator |=.

first time with it, what exactky does???
See K&R2, page 50.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 16 '06 #2

P: n/a
yeah, that page is about flow control but I donīt think this is the
problem. Is not flow, is assigment.

this was the line:

*cmd |= newcmd;

greetings
Erick->


Richard Heathfield wrote:
Erick-said:
hello!!

I was looking at some code in C... and saw this "exotic" operator |=.

first time with it, what exactky does???

See K&R2, page 50.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 16 '06 #3

P: n/a
Erick-wrote:
hello!!

I was looking at some code in C... and saw this "exotic" operator |=.

first time with it, what exactky does???

The lvalue on the left is inclusive-OR'd with the expression on the
right, and the result is stored in the lvalue.


Nov 16 '06 #4

P: n/a
:( I don't follow it

do you have a little example?? please!!!

thanks a lot!

Erick->
james of tucson wrote:
Erick-wrote:
hello!!

I was looking at some code in C... and saw this "exotic" operator |=.

first time with it, what exactky does???


The lvalue on the left is inclusive-OR'd with the expression on the
right, and the result is stored in the lvalue.
Nov 16 '06 #5

P: n/a

Erick-a écrit :
yeah, that page is about flow control but I donīt think this is the
problem. Is not flow, is assigment.

this was the line:

*cmd |= newcmd;

greetings
Erick->
The | operator is the bitwise OR operator. Well, in the same way the
expression x += 1; is equivalent to the x = x +1;, the above mentionned
expression is equivalent to:

*cmd = *cmd | newcmd;

Thierry

Nov 16 '06 #6

P: n/a
thank you!!!!

Thierry Chappuis wrote:
Erick-a écrit :
yeah, that page is about flow control but I donīt think this is the
problem. Is not flow, is assigment.

this was the line:

*cmd |= newcmd;

greetings
Erick->

The | operator is the bitwise OR operator. Well, in the same way the
expression x += 1; is equivalent to the x = x +1;, the above mentionned
expression is equivalent to:

*cmd = *cmd | newcmd;

Thierry
Nov 16 '06 #7

P: n/a
Erick-wrote:
Richard Heathfield wrote:
>Erick-said:
>>hello!!

I was looking at some code in C... and saw this "exotic" operator |=.

first time with it, what exactky does???
See K&R2, page 50.

yeah, that page is about flow control but I donīt think this is the
problem. Is not flow, is assigment.

this was the line:

*cmd |= newcmd;
Pleas don't top-post. I put your reply at the bottom of the
message you replied to and I kept the attribution line (the first
line: Erick-wrote: ) at the top (so everyone knows who wrote
what and in what order).

|= is like +=, -= and so on. It means that the variable
(actually, lvalue) to the left of the operator will take a value
equal to its original value bitwise-OR-ed with the value on the
right of the operator, e.g. a|=b is equivalent with a=a|b.
--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)
Nov 16 '06 #8

P: n/a

Nelu wrote:
Erick-wrote:
Richard Heathfield wrote:
Erick-said:

hello!!

I was looking at some code in C... and saw this "exotic" operator |=.

first time with it, what exactky does???
See K&R2, page 50.
yeah, that page is about flow control but I donīt think this is the
problem. Is not flow, is assigment.

this was the line:

*cmd |= newcmd;

Pleas don't top-post. I put your reply at the bottom of the
message you replied to and I kept the attribution line (the first
line: Erick-wrote: ) at the top (so everyone knows who wrote
what and in what order).

|= is like +=, -= and so on. It means that the variable
(actually, lvalue) to the left of the operator will take a value
equal to its original value bitwise-OR-ed with the value on the
right of the operator, e.g. a|=b is equivalent with a=a|b.
--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)

like this?

Nov 16 '06 #9

P: n/a
Op 16 Nov 2006 14:53:42 -0800 schreef Erick->:
Richard Heathfield wrote:
>Erick-said:
>>hello!!

I was looking at some code in C... and saw this "exotic" operator |=.

first time with it, what exactky does???

See K&R2, page 50.
yeah, that page is about flow control but I donīt think this is the
problem. Is not flow, is assigment.

this was the line:

*cmd |= newcmd;
(Topposting corrected)
No, page 50 contains '2.10 Assignment Operators and Expressions' which is
just what Richard Heathfield meant.

See the line 'expr1 op = expr2'
--
Coos
Nov 16 '06 #10

P: n/a
Erick-wrote:
Nelu wrote:
>Erick-wrote:
>>Richard Heathfield wrote:
Erick-said:

hello!!
>
I was looking at some code in C... and saw this "exotic" operator |=.
>
first time with it, what exactky does???
See K&R2, page 50.

yeah, that page is about flow control but I donīt think this is the
problem. Is not flow, is assigment.

this was the line:

*cmd |= newcmd;
Pleas don't top-post. I put your reply at the bottom of the
message you replied to and I kept the attribution line (the first
line: Erick-wrote: ) at the top (so everyone knows who wrote
what and in what order).

|= is like +=, -= and so on. It means that the variable
(actually, lvalue) to the left of the operator will take a value
equal to its original value bitwise-OR-ed with the value on the
right of the operator, e.g. a|=b is equivalent with a=a|b.
--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)


like this?
Yes, you can also snip the signatures. They don't contain any
information that is relevant to the discussion. You can also snip
other stuff that you don't think is relevant to a follow-up. Just
make sure to keep the attributions and follow-up levels untouched
(when you snip) so you don't mangle posters and follow-ups.

--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)
Nov 16 '06 #11

P: n/a
"Erick->" wrote:
>
I was looking at some code in C... and saw this "exotic" operator |=.

first time with it, what exactky does???
What does '+' do? What does '+=' do? What does '|' do? Now, what
do you think '|=" does?

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Nov 17 '06 #12

P: n/a
"Erick->" wrote:
>
yeah, that page is about flow control but I donīt think this is
the problem. Is not flow, is assigment.
Don't top-post. See the links below.

--
Some informative links:
<news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>
Nov 17 '06 #13

P: n/a
Erick-said:
yeah, that page is about flow control
No, it isn't. It's entitled "Assignment operators and expressions", and it
answers your question.

Before learning to program, I suggest learning to read.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 17 '06 #14

P: n/a
in 706142 20061117 080810 Richard Heathfield <in*****@invalid.invalidwrote:
>Erick-said:
>yeah, that page is about flow control

No, it isn't. It's entitled "Assignment operators and expressions", and it
answers your question.

Before learning to program, I suggest learning to read.
If you can't say something useful it would be better to say nothing at all.
Nov 17 '06 #15

P: n/a
Bob Martin said:
in 706142 20061117 080810 Richard Heathfield <in*****@invalid.invalid>
wrote:
>>Erick-said:
>>yeah, that page is about flow control

No, it isn't. It's entitled "Assignment operators and expressions", and it
answers your question.

Before learning to program, I suggest learning to read.

If you can't say something useful it would be better to say nothing at
all.
Indeed. That's why all my replies in this thread (including this one) have
been useful. If you can't see the use of what I have written, that may not
be the fault of the writer.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 17 '06 #16

P: n/a

Erick-wrote:
Richard Heathfield wrote:
Erick-said:
hello!!
>
I was looking at some code in C... and saw this "exotic" operator |=.
>
first time with it, what exactky does???
See K&R2, page 50.
yeah, that page is about flow control but I donīt think this is the
problem. Is not flow, is assigment.
Richard was refering to Kernighan and Ritchie 2nd Edition, I think you
are probably looking at first edition, where page 46 would be relevant.

|= indicates where the programmer donned a top-hat.

Nov 17 '06 #17

P: n/a

Bob Martin said:
in 706142 20061117 080810 Richard Heathfield <in*****@invalid.invalid>
wrote:
>Erick-said:

yeah, that page is about flow control

No, it isn't. It's entitled "Assignment operators and expressions", and it
answers your question.

Before learning to program, I suggest learning to read.
If you can't say something useful it would be better to say nothing at
all.

Indeed. That's why all my replies in this thread (including this one) have
been useful. If you can't see the use of what I have written, that may not
be the fault of the writer.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
do you want to see this book?? with the page NUMBER 50 with the first
line: "Chapter 3 - Control Flow" ???

was the page 46: 2.10 Assignment Operators and Expressions. thanks.
>>"Before learning to program, I suggest learning to read"
yeah, sure.

sorry for not have the same book and same edition :):). (next time
would be better if you say: read the section 2.10 of K&R book).

Nov 17 '06 #18

P: n/a
Erick-said:
do you want to see this book?? with the page NUMBER 50 with the first
line: "Chapter 3 - Control Flow" ???
If that is the case, then it isn't the book I suggested you consult, i.e.
K&R2. Clearly, if you consult some other book, my page reference will not
be valid, but it is certainly valid for the book I suggested.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 17 '06 #19

P: n/a
Richard Heathfield <in*****@invalid.invalidwrites:
Erick-said:
>do you want to see this book?? with the page NUMBER 50 with the first
line: "Chapter 3 - Control Flow" ???

If that is the case, then it isn't the book I suggested you consult, i.e.
K&R2. Clearly, if you consult some other book, my page reference will not
be valid, but it is certainly valid for the book I suggested.
Are there different printings of K&R2 with different page numbering?

There have been two major editions of K&R (Kernighan & Ritchie, _The C
Programming Language_). The first edition is now mostly of historical
interest. The second edition describes the language standardized by
the 1989 ANSI standard and the 1990 ISO standard. (There are no plans
for a new edition covering the 1999 standard.)

I have both editions, but they're not available at the moment.

Erick, if you're looking at the first edition, you should get a copy
of the second edition.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 17 '06 #20

P: n/a
Keith Thompson said:
Richard Heathfield <in*****@invalid.invalidwrites:
>Erick-said:
>>do you want to see this book?? with the page NUMBER 50 with the first
line: "Chapter 3 - Control Flow" ???

If that is the case, then it isn't the book I suggested you consult, i.e.
K&R2. Clearly, if you consult some other book, my page reference will not
be valid, but it is certainly valid for the book I suggested.

Are there different printings of K&R2 with different page numbering?
No.
There have been two major editions of K&R (Kernighan & Ritchie, _The C
Programming Language_). The first edition is now mostly of historical
interest. The second edition describes the language standardized by
the 1989 ANSI standard and the 1990 ISO standard. (There are no plans
for a new edition covering the 1999 standard.)
There was also an interim edition, based on the ANSI C draft - and it turned
out to be identical to the second edition.

Even the hardback version (which I also have) has identical page-numbering.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 17 '06 #21

P: n/a
On Fri, 17 Nov 2006 20:35:02 GMT, in comp.lang.c , Keith Thompson
<ks***@mib.orgwrote:
>Richard Heathfield <in*****@invalid.invalidwrites:
>Erick-said:
>>do you want to see this book?? with the page NUMBER 50 with the first
line: "Chapter 3 - Control Flow" ???

If that is the case, then it isn't the book I suggested you consult, i.e.
K&R2. Clearly, if you consult some other book, my page reference will not
be valid, but it is certainly valid for the book I suggested.

Are there different printings of K&R2 with different page numbering?
He may be looking at a non-English impression, which would most likely
have different page numbering.
>Erick, if you're looking at the first edition, you should get a copy
of the second edition.
Page 50 of K&R (1978) starts with the words "similarly, the order in
which..." and talks about function argument evaluation order.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Nov 17 '06 #22

P: n/a
On Fri, 17 Nov 2006 20:57:31 +0000, in comp.lang.c , Richard
Heathfield <in*****@invalid.invalidwrote:
>Keith Thompson said:
>Are there different printings of K&R2 with different page numbering?

No.
Absurd claim.

One might reasonably expect foreign language copies to have different
page numbering, and indeed a UK pressing might well be different to a
US one, or a reprint on smaller pagesize, or...
>Even the hardback version (which I also have) has identical page-numbering.
Perhaps, but as with the output of compilers, empirical evidence of
your particular environment is not a general proof.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Nov 17 '06 #23

P: n/a
Op Fri, 17 Nov 2006 22:53:19 +0000 schreef Mark McIntyre:

<snip>
Page 50 of K&R (1978) starts with the words "similarly, the order in
which..." and talks about function argument evaluation order.
That's on the middle of page 53.
Page 50 begins with the header '2.10 Assignment Operators...' as I wrote
earlier.
I have the paperback version of 1988, ISBN 0-13-110362-8.
Bought for nearly EUR 50 in 2003.
--
Coos
Nov 17 '06 #24

P: n/a
Mark McIntyre <ma**********@spamcop.netwrites:
On Fri, 17 Nov 2006 20:35:02 GMT, in comp.lang.c , Keith Thompson
<ks***@mib.orgwrote:
>>Richard Heathfield <in*****@invalid.invalidwrites:
>>Erick-said:
do you want to see this book?? with the page NUMBER 50 with the first
line: "Chapter 3 - Control Flow" ???

If that is the case, then it isn't the book I suggested you consult, i.e.
K&R2. Clearly, if you consult some other book, my page reference will not
be valid, but it is certainly valid for the book I suggested.

Are there different printings of K&R2 with different page numbering?

He may be looking at a non-English impression, which would most likely
have different page numbering.
>>Erick, if you're looking at the first edition, you should get a copy
of the second edition.

Page 50 of K&R (1978) starts with the words "similarly, the order in
which..." and talks about function argument evaluation order.
It's the same in my copy of K&R1. That's the last page of the section
on Precedence and Order of Evaluation. Chapter 3, on Control Flow,
starts on page 51.

In my copy of K&R2, page 50 is the first page of the section on
Assignment Operators and expressions; chapter 3, on Control Flow,
starts on page 55.

Either Erick has made a mistake (hey, it happens), or he has some
other edition.

There are a multitude of translations into languages other than
English; see <http://cm.bell-labs.com/cm/cs/cbook/>. That page
mentions that many of the errata have been corrected in recent
printings; it's plausible that some of those corrections might have
caused page shifts (though probably not from 50 to 55, assuming we're
talking about K&R2).

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 17 '06 #25

P: n/a
Mark McIntyre said:
On Fri, 17 Nov 2006 20:35:02 GMT, in comp.lang.c , Keith Thompson
<ks***@mib.orgwrote:
>>Richard Heathfield <in*****@invalid.invalidwrites:
>>Erick-said:
do you want to see this book?? with the page NUMBER 50 with the first
line: "Chapter 3 - Control Flow" ???

If that is the case, then it isn't the book I suggested you consult,
i.e. K&R2. Clearly, if you consult some other book, my page reference
will not be valid, but it is certainly valid for the book I suggested.

Are there different printings of K&R2 with different page numbering?

He may be looking at a non-English impression, which would most likely
have different page numbering.
That is entirely possible. If it is in fact the case, then I owe the OP an
apology.
>>Erick, if you're looking at the first edition, you should get a copy
of the second edition.

Page 50 of K&R (1978) starts with the words "similarly, the order in
which..." and talks about function argument evaluation order.
And in any case, I specified K&R2, not K&R.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 17 '06 #26

P: n/a
Mark McIntyre said:
On Fri, 17 Nov 2006 20:57:31 +0000, in comp.lang.c , Richard
Heathfield <in*****@invalid.invalidwrote:
>>Keith Thompson said:
>>Are there different printings of K&R2 with different page numbering?

No.

Absurd claim.
I thought I was supposed to be in your killfile.
One might reasonably expect foreign language copies to have different
page numbering, and indeed a UK pressing might well be different to a
US one, or a reprint on smaller pagesize, or...
Yes, it's true that I hadn't considered that possibility.
>>Even the hardback version (which I also have) has identical
page-numbering.

Perhaps, but as with the output of compilers, empirical evidence of
your particular environment is not a general proof.
Do you have a counter-example in English?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 17 '06 #27

P: n/a

Coos Haak wrote:
Op Fri, 17 Nov 2006 22:53:19 +0000 schreef Mark McIntyre:

<snip>
Page 50 of K&R (1978) starts with the words "similarly, the order in
which..." and talks about function argument evaluation order.

That's on the middle of page 53.
Page 50 begins with the header '2.10 Assignment Operators...' as I wrote
earlier. I have the paperback version of 1988, ISBN 0-13-110362-8.
Bought for nearly EUR 50 in 2003.
You're talking about K&R2. Mark was talking about K&R, since the most
likely cause of the confusion was that the OP looked at K&R rather than
the K&R2 which Richard specified. It looks like the OP's printing
differs from both the common standard editions.

Nov 18 '06 #28

P: n/a
On Fri, 17 Nov 2006 23:41:24 +0000, in comp.lang.c , Richard
Heathfield <in*****@invalid.invalidwrote:
>Mark McIntyre said:
>On Fri, 17 Nov 2006 20:57:31 +0000, in comp.lang.c , Richard
Heathfield <in*****@invalid.invalidwrote:
>>>Even the hardback version (which I also have) has identical
page-numbering.

Perhaps, but as with the output of compilers, empirical evidence of
your particular environment is not a general proof.

Do you have a counter-example in English?
Thats irrelevant, and you know it as well as I do. And for what its
worth the OP had a book with different page numbering to you so we
already have an example (*)

I'm sorry Richard, but you're being foolish, and you know it.
(*) a petty minded person would at this point claim that the OP must
have been referring to a different book. Naturally, the petty-minded
person cannot possibly be mistaken, clearly only everyone else can be
wrong.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Nov 18 '06 #29

P: n/a
On Sat, 18 Nov 2006 00:34:16 +0100, in comp.lang.c , Coos Haak
<ch*****@hccnet.nlwrote:
>Op Fri, 17 Nov 2006 22:53:19 +0000 schreef Mark McIntyre:

<snip>
>Page 50 of K&R (1978) starts with the words "similarly, the order in
which..." and talks about function argument evaluation order.

That's on the middle of page 53.
Page 50 begins with the header '2.10 Assignment Operators...' as I wrote
earlier.
I have the paperback version of 1988, ISBN 0-13-110362-8.
Bought for nearly EUR 50 in 2003.
Thats K&R2. Note that I said K&R(1978)

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Nov 18 '06 #30

P: n/a
Op 17 Nov 2006 17:39:01 -0800 schreef J. J. Farrell:
Coos Haak wrote:
>Op Fri, 17 Nov 2006 22:53:19 +0000 schreef Mark McIntyre:

<snip>
>>Page 50 of K&R (1978) starts with the words "similarly, the order in
which..." and talks about function argument evaluation order.

That's on the middle of page 53.
Page 50 begins with the header '2.10 Assignment Operators...' as I wrote
earlier. I have the paperback version of 1988, ISBN 0-13-110362-8.
Bought for nearly EUR 50 in 2003.

You're talking about K&R2. Mark was talking about K&R, since the most
likely cause of the confusion was that the OP looked at K&R rather than
the K&R2 which Richard specified. It looks like the OP's printing
differs from both the common standard editions.
That may be, but Keith and Richard were talking about K&R2, so was I. That
version is IMHO more authorative ;-)
--
Coos
Nov 18 '06 #31

P: n/a
Mark McIntyre said:
On Fri, 17 Nov 2006 23:41:24 +0000, in comp.lang.c , Richard
Heathfield <in*****@invalid.invalidwrote:
>>Mark McIntyre said:
>>On Fri, 17 Nov 2006 20:57:31 +0000, in comp.lang.c , Richard
Heathfield <in*****@invalid.invalidwrote:

Even the hardback version (which I also have) has identical
page-numbering.

Perhaps, but as with the output of compilers, empirical evidence of
your particular environment is not a general proof.

Do you have a counter-example in English?

Thats irrelevant, and you know it as well as I do.
No, it isn't. What you're suggesting is that there's a hitherto undiscovered
edition of K&R2. If that's true, it's important and indeed radical news,
but if it's not true, it's just nonsense.
And for what its
worth the OP had a book with different page numbering to you so we
already have an example (*)
I am not convinced that this is the case. I think it far more likely that
he's got an illegal e-version with faulty numbering, although of course
that is mere supposition on my part.
I'm sorry Richard, but you're being foolish, and you know it.
Wrong.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 18 '06 #32

P: n/a
On Sat, 18 Nov 2006 12:36:13 +0000, in comp.lang.c , Richard
Heathfield <in*****@invalid.invalidwrote:
>Mark McIntyre said:
>On Fri, 17 Nov 2006 23:41:24 +0000, in comp.lang.c , Richard
Heathfield <in*****@invalid.invalidwrote:
>>>
Do you have a counter-example in English?

Thats irrelevant, and you know it as well as I do.

No, it isn't. What you're suggesting is that there's a hitherto undiscovered
edition of K&R2.
Thats not what I'm suggesting, though I'm sorry to say I actually
*expected* you to twist the discussion round to bolster your weak
position.

Why on earth are you being so childish? Can't you just accept that
there may be different pressings of a book with different
pagenumbering? What do you hope to gain by pursuing a line that all
other posters have already accepted is flawed?
>I'm sorry Richard, but you're being foolish, and you know it.

Wrong.
Its a real shame, you used to be quite sensible.


--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Nov 19 '06 #33

P: n/a
Mark McIntyre said:

<snip>
>
Why on earth are you being so childish?
Why do you so often use the word "childish" to describe people who disagree
with you?
Can't you just accept that
there may be different pressings of a book with different
pagenumbering?
Of course I can, but I can also accept that in K&R2's case, this doesn't
appear to have happened, and I note that the page numbering is sufficiently
consistent for the K&R2 Errata page to be able to refer to page numbers
throughout without ever having to say which pressing of the book it is
referring to. So I have good evidence to support my view, whereas all you
appear to have in support of yours is mere supposition.
What do you hope to gain by pursuing a line that all
other posters have already accepted is flawed?
Truth is not democratic. Just because lots of people think 2+2=5, that
doesn't make it so.
>>I'm sorry Richard, but you're being foolish, and you know it.

Wrong.

Its a real shame, you used to be quite sensible.
And I haven't changed.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 19 '06 #34

P: n/a

Richard Heathfield schrieb:
Erick-said:
yeah, that page is about flow control

No, it isn't. It's entitled "Assignment operators and expressions", and it
answers your question.

Before learning to program, I suggest learning to read.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Have you all thought about things like different language editions of
K&R, which could be different in numbering? Although I don't think it
really matters, it is a pretty weird discussion on where you find what
in K&R. He might have another edition, or even a misprint, so there is
no way to determine that from your side of the river.

That doesn't give erick a free ticket to feel great, since if he had
looked into the index at the back of the book, he would have discovered
a list of all operators on the second last page.

But there is no need, to be honest, for displaced and somehow offensive
language that spawns more aggression.

Sincerely,
Thomas

Nov 19 '06 #35

P: n/a
"Erick->" <er*********@gmail.comwrites:
>Bob Martin said:
[...]
do you want to see this book?? with the page NUMBER 50 with the first
line: "Chapter 3 - Control Flow" ???

was the page 46: 2.10 Assignment Operators and Expressions. thanks.
>>>"Before learning to program, I suggest learning to read"
yeah, sure.

sorry for not have the same book and same edition :):). (next time
would be better if you say: read the section 2.10 of K&R book).
Erick, as you can see if you've been following this thread, the
question of which section is on which page has generated, shall we
say, a great deal of enthusiastic interest. (Ok, flames.)

Personally, I'd be interested in knowing whether we can assume that
page numbers in different English printings of a given edition of K&R
are consistent or not. If we can't, then we need to be more careful
in providing citations.

I checked my own copies of both K&R1 and K&R2, and found the following:

| It's the same in my copy of K&R1. That's the last page of the section
| on Precedence and Order of Evaluation. Chapter 3, on Control Flow,
| starts on page 51.
|
| In my copy of K&R2, page 50 is the first page of the section on
| Assignment Operators and expressions; chapter 3, on Control Flow,
| starts on page 55.

What you found on page 50 appears to be inconsistent with that. So if
you can provide some more information, I'd appreciate it.

Is your book the 1st or 2nd edition? Is it an English printing, or
one in some other language? Is there any other useful information on
the cover or title page (Nth printing, special edition, etc.)? What
section appears on page 50? What is the first line of text on page
50? On what page does Chapter 3, Control Flow, start?

(If you're using a 1st edition, I'd advise you to find a copy of the
2nd edition.)

Thank you.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 19 '06 #36

P: n/a
Richard Heathfield wrote:
Why do you so often use the word "childish" to describe people who disagree
with you?
That's rich coming from someone who unnecessarily accused a poster of
not being able to read.
And I haven't changed.
It seems to me that comp.lang.c has made you more than a little bit
bitter.

-Joal

Nov 20 '06 #37

P: n/a
Joal said:
Richard Heathfield wrote:
>Why do you so often use the word "childish" to describe people who
disagree with you?

That's rich coming from someone who unnecessarily accused a poster of
not being able to read.
Okay. I've apologised for that, on the basis that the OP *might* have been
using a foreign language edition. Unlikely, but possible.
>And I haven't changed.

It seems to me that comp.lang.c has made you more than a little bit
bitter.
It seems to me that comp.lang.c has done no such thing. I'm perfectly happy,
perfectly equitable, and perfectly capable of not putting up with nonsense
from people (such as Mark and Mr Navia) who should know better.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
Nov 20 '06 #38

This discussion thread is closed

Replies have been disabled for this discussion.