Solved

bit wise operations in c/c++

Posted on 2013-10-23
1
390 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 84

Accepted Solution

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

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
returning a dereferenced pts in C++ 10 149
VS2015 compilation and missing DLLs 9 147
Compile GLUT with Visual Studio 2015 1 144
Find Visual Studio Tools 2 103
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

770 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