From 1d1a42a84c0536bf15bb8d64e53491c39d491114 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Wed, 8 Sep 2021 00:34:56 +0300 Subject: [PATCH] lesson_49 --- lesson_49/main.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lesson_49/main.cpp diff --git a/lesson_49/main.cpp b/lesson_49/main.cpp new file mode 100644 index 0000000..d7a7525 --- /dev/null +++ b/lesson_49/main.cpp @@ -0,0 +1,27 @@ +/* + * main.cpp + * + * Created on: 8 сент. 2021 г. + * Author: alexander + */ +#include +#include + +using namespace std; + +int main() +{ + unsigned char option_viewed = 0x01; + unsigned char option_edited = 0x02; + unsigned char option_favorited = 0x04; + unsigned char option_shared = 0x08; + unsigned char option_deleted = 0x80; + + unsigned char myArticleFlags = 0x0; + + cout << (myArticleFlags | option_viewed) << endl; + cout << (myArticleFlags & option_viewed) << endl; + cout << (myArticleFlags & ~option_viewed) << endl; + + return 0; +}