The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM



Thread: bitwise and if
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-26-2008
Puntino Puntino is offline
Registered User
 

Join Date: Apr 2008
Posts: 30
bitwise and if

Hi

Suppose we have these code lines:

#define _IN_USE 0x001 /* set when process slot is in use */
#define _EXITING 0x002 /* set when exit is expected */
#define _REFRESHING 0x004

...
1 main () {
2
3 unsigned r_flags =_REFRESHING;
4
5 if (r_flag & _IN_USE){
6 if (r_flag & _EXITING){
7 printf("EXITING");
8 }
9 if (r_flag & _REFRESHING){
10 printf("REFRESHING");
11 }
12 }
13 }

Will i see on the screen the string REFRESING ? (line 10)
Can I say that REFRESCHING and EXITING are two particular cases of the more generic IN_USE?
Than you in advance
Reply With Quote
Forum Sponsor