Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

bit wise operations in c/c++

Posted on 2013-10-23
1
Medium Priority
?
397 Views
Last Modified: 2013-10-23
Hi Experts,

are those two operations the same :

#define   x   0x00020000    
#define   y   0x00040000    
#define   z    0x00080000    


MyFlag = x | y | z;    is it the same thing as :

MyFlag = x  | y;
MyFlag |= z;

Please this is urgent.

Thanks;
0
Comment
Question by:bachra04
1 Comment
 
LVL 85

Accepted Solution

by:
ozo earned 2000 total points
ID: 39594332
Yes
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question