473,804 Members | 3,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what exactly does the operator |= ???

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
37 2004
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 #11
"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
"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.anno unce.newusers
<http://www.geocities.c om/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html >
<http://www.netmeister. org/news/learn2quote.htm l>
<http://cfaj.freeshell. org/google/>
Nov 17 '06 #13
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
in 706142 20061117 080810 Richard Heathfield <in*****@invali d.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
Bob Martin said:
in 706142 20061117 080810 Richard Heathfield <in*****@invali d.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

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

Bob Martin said:
in 706142 20061117 080810 Richard Heathfield <in*****@invali d.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
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
Richard Heathfield <in*****@invali d.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_Keit h) 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

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

Similar topics

226
12734
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> d1 = {'a':1} >>> d2 = {'b':2} >>> d3 = {'c':3}
70
8919
by: Roy Yao | last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ? According to my analysis, operator sizeof, (type) and * have the same precedence, and they combine from right to left. Then this expression should equal to "sizeof( (int)(*p) )", but the compiler does NOT think so. Why? Can anyone help me? Thanks. Best regards. Roy
2
1374
by: Alexander Stippler | last post by:
Hi, I've got a question concerning iterators. I'm writing some container class and iterators upon it. I have to have typedef typex pointer; typedef typey reference; to be standard conforming. But what semantic requirements does the standard expose on type typey (and typex). If I define reference operator*(), does the object I return have to be (non-const) referencable or can I return
12
3307
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. Such things happen. The whole subsystem is going through radical changes. I don't really want to say what I think of the code just yet. That would influence the opinions of others, and I really want to know how other people view these things,...
2
3511
by: Steven T. Hatton | last post by:
I'm still not completely sure what's going on with C++ I/O regarding the extractors and inserters. The following document seems a bit inconsistent: http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#1 Copying a file: WRONG WAY: #include <fstream> std::ifstream IN ("input_file"); std::ofstream OUT ("output_file");
17
3505
by: Anoob | last post by:
Can we consider () unary operator when calling a function, in exps eq. f(), ( 1 + 2). But when we call function f( 10 ) it is a binary operator. Even if we pass f( 10, 20) as we are using , operator there one operand will be there for ()? And Unary operators like !, +, -, ~, ... are said to be having associativity right to left which means that we can write, (but not allowed) 1. 2! 2. !2
24
2969
by: Romeo Colacitti | last post by:
Hi, Does anyone here have a strong understanding for the meanings of the terms "lvalue" and "rvalue" as it pertains to C, objects, and different contexts? If so please share. I've been reading several old posts/threads on the subject, and they never end with a conclusion (people keep correcting each other and disagreeing).
15
1855
by: Pranav | last post by:
class just{ public : int x; just(){ x=1234; } just(int i){ x = i;} ~just(){ cout << " Here We Are\n" ;} }; int main() {
2
1791
by: Peng Yu | last post by:
Hi, In the following code, the 'copy' member function works. But the '=' operator does not work. Can somebody let me know why a member function is different from an operator. Thanks, Peng #include <iostream>
0
9706
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
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10330
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
10319
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,...
1
7616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
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();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
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

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.