473,396 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

compound assignment operator

Can someone please tell me what this assignment does?
iType |= EB_YMIN_ZMAX;

Jul 19 '05 #1
4 3996
"Vasileios Zografos" <vz*******@bcs.org.uk> wrote...
Can someone please tell me what this assignment does?
iType |= EB_YMIN_ZMAX;


The same as

iType = iType | EB_YMIN_ZMAX;

with the exception that 'iType' is only evaluated once.

Victor
Jul 19 '05 #2
Victor Bazarov wrote:
"Vasileios Zografos" <vz*******@bcs.org.uk> wrote...
Can someone please tell me what this assignment does?
iType |= EB_YMIN_ZMAX;

The same as

iType = iType | EB_YMIN_ZMAX;

with the exception that 'iType' is only evaluated once.

Victor


Trying not to sound too ignorant....
what does | do?

Jul 19 '05 #3
"Vasileios Zografos" <vz*******@bcs.org.uk> wrote...
Victor Bazarov wrote:
"Vasileios Zografos" <vz*******@bcs.org.uk> wrote...
Can someone please tell me what this assignment does?
iType |= EB_YMIN_ZMAX;

The same as

iType = iType | EB_YMIN_ZMAX;

with the exception that 'iType' is only evaluated once.

Victor


Trying not to sound too ignorant....
what does | do?


It's what is known as "bitwise OR". Every pair of corresponding
bits in the operands is 'or'ed to produce the corresponding bit
in the result. Example:

010100101001110101 | 000100010101101001 => 010100111101111101

Victor
Jul 19 '05 #4
Vasileios Zografos wrote:
Victor Bazarov wrote:
"Vasileios Zografos" <vz*******@bcs.org.uk> wrote...
Can someone please tell me what this assignment does?
iType |= EB_YMIN_ZMAX;

The same as

iType = iType | EB_YMIN_ZMAX;

with the exception that 'iType' is only evaluated once.

Victor


Trying not to sound too ignorant....
what does | do?


Bitwise OR:

A B A OR B
--- --- ------
0 0 0
0 1 1
1 0 1
1 1 1

The bitwise-OR operator is often used to "set" bits.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 19 '05 #5

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

Similar topics

8
by: Nitin Bhardwaj | last post by:
Thanx in advance for the response... I wanna enquire ( as it is asked many a times in Interviews that i face as an Engg PostGraduate ) about the overloading capability of the C++ Language. ...
5
by: CoolPint | last post by:
It seems to me that I cannot assign objects of a class which has a constant data member since the data member cannot be changed once the constructor calls are completed. Is this the way it is meant...
16
by: Edward Diener | last post by:
Is there a way to override the default processing of the assignment operator for one's own __value types ? I realize I can program my own Assign method, and provide that for end-users of my class,...
9
by: Rick N. Backer | last post by:
I have an abstract base class that has char* members. Is an assignment operator necessary for this abstract base class? Why or why not? Thanks in advance. Ken Wilson Amer. Dlx. Tele,...
1
by: Jon Slaughter | last post by:
I have a chain of classes(i.e., a series of classes each containing an array of the next class). Each class has array like access. struct Myclass1 { vector(Myclass2) _Myclass2; Myclass2&...
6
by: Neil Zanella | last post by:
Hello, I would like to know whether the following C fragment is legal in standard C and behaves as intended under conforming implementations... union foo { char c; double d; };
6
by: William Ahern | last post by:
So, GCC 4.01 is giving errors that GCC 3.3 did not, and I'm thinking they've gone overboard with their new type checking infrastructure. Here's the supposedly offending code (no laughing or...
5
by: raylopez99 | last post by:
I need an example of a managed overloaded assignment operator for a reference class, so I can equate two classes A1 and A2, say called ARefClass, in this manner: A1=A2;. For some strange reason...
3
by: Time | last post by:
The expression : a=a+4can also be written as; a+=4. This is called as compound assignment operator. In Complete reference of java it is given that compound assignment operators are implemented more...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.