Solved

XOR on byte

Posted on 1997-08-06
1
1,184 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
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 opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

762 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

9 Experts available now in Live!

Get 1:1 Help Now