Skip to content
EMPS intranet

Back to top
Hi!   Hi!           Start program

Try stepping through the code


  Value and type of last evaluated expression: Address of array element: Address of array elementx:  (none)

Your browser does not support the canvas element which will make some the features unavailable.

If you are using Internet Explorer within the University of Exeter try going to the Settings menu (probably the gear shape at the top right of this page), selecting "Compatibility View settings", unchecking "Display intranet sites in Compatibility View" and reloading this page.

Code

 Header...
#define OPTION1 0x01 // 1 binary 00000001 #define OPTION2 0x02 // 2 binary 00000010 #define OPTION3 0x04 // 4 binary 00000100 #define OPTION4 0x08 // 8 binary 00001000 #define OPTION5 0x10 // 16 binary 00010000 #define OPTION6 0x20 // 32 binary 00100000 unsigned int flags;
int main(void){ » flags|=OPTION3;// Set OPTION3 » flags|=OPTION4;// Set OPTION3 » flags&=~OPTION4;// Unset OPTION4 » if ((flags&OPTION3)) printf("Option 3 is set\n"); » return 0; }
...
Memory

Static variables

260
261
262
263
flags = 0

NB: the actual memory address of each variable is the
address shown plus -128 (0xFFFFFFFFFFFFFF80).

Show Advanced options

.
Show output (Before looking at the output, work out what you think it put should be and see if you are right.)

Output

Option 3 is set
                                                                                                                                                                                                                                                                       

Validate   Link-check © Copyright & disclaimer Share
Back to top