By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,421 Members | 1,127 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,421 IT Pros & Developers. It's quick & easy.

Declaration

P: 2
I m working on a built project and I have to understand it for further enhancements.
I see a code declaration as

unsigned nFlags = LOCAL | FOREIGN

what is this way to declare and assign..
I don't understand it, Please help me...
Mar 8 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,510
I m working on a built project and I have to understand it for further enhancements.
I see a code declaration as

unsigned nFlags = LOCAL | FOREIGN

what is this way to declare and assign..
I don't understand it, Please help me...
this means
Expand|Select|Wrap|Line Numbers
  1. unsigned int nFlags = LOCAL | FOREIGN
in C you can omit the int, it is initialised with the value LOCAL | FOREIGN where | is the bitwise OR operator
Mar 8 '07 #2

100+
P: 1,646
I m working on a built project and I have to understand it for further enhancements.
I see a code declaration as

unsigned nFlags = LOCAL | FOREIGN

what is this way to declare and assign..
I don't understand it, Please help me...
If I take a wild guess, it looks like two 16 bit flags are being packed into a 32 bit unsigned integer.
Mar 8 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.