Solved

bit wise operations in c/c++

Posted on 2013-10-23
1
382 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
Comment Utility
Yes
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now