?
Solved

XOR on byte

Posted on 1997-08-06
1
Medium Priority
?
1,197 Views
Last Modified: 2012-06-21
How can I perform a XOR operation on 2 bytes?

example
00000110 (1st byte)
00000010 (2nd byte)

00000100 (result)

Another question is whether all files are stored in multiples of bytes?  Example, 12 bytes.  No files are stored in 12bytes 6 bits.

thanks
0
Comment
Question by:YamSeng
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
rbr earned 60 total points
ID: 1252960
First question:

Try

unsigned char a,b,result;

a=(char)6;
b=(char)4;

result=a^b;

Second question:

Sure files are stored in multiples of bytes an all systems I know. DOS, Windows, OS/2, MAC, Linux. They are even stored in a large block. Almost every OS has an minimal block or cluster size, which are often a power of 2. So if your cluster size is e.g. 8192 a file which uses only 4 bytes will use 8192 bytes of your HD.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question