summaryrefslogtreecommitdiff
path: root/CSAPP/xor.c
diff options
context:
space:
mode:
Diffstat (limited to 'CSAPP/xor.c')
-rw-r--r--CSAPP/xor.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/CSAPP/xor.c b/CSAPP/xor.c
new file mode 100644
index 0000000..2cbf95a
--- /dev/null
+++ b/CSAPP/xor.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+int main(void) {
+
+ int x = 0xA14D6C50;
+
+ printf("Original: 0x%x\n", x);
+ printf("~x ^ 0xFF: 0x%x\n", ~x ^ 0xFF);
+ printf("x ^ ~0xFF: 0x%x\n", x ^ ~0xFF);
+
+ return 0;
+}