Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- using namespace std;
- int main()
- {
- union Pill
- {
- bool red_pill; //Pointer----|
- bool blue_pill; //Pointer--------[Memory-Address]
- bool green_pill;//Pointer----|
- };
- Pill pill_object;
- pill_object.red_pill = true;
- if(pill_object.red_pill)
- {
- cout << "You survived." << endl;
- }
- else
- {
- cout << "You died." << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement