Solved

XOR on byte

Posted on 1997-08-06
1
1,188 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
1 Comment
 
LVL 10

Accepted Solution

by:
rbr earned 20 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now