473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Interchange 2 nibbles of byte

How to interchange the two nibbles of a byte without
using any bitwise operator.
Jul 19 '05 #1
4 2998
unsigned char a;
a = a * 16 + a/16;

But why would you want to do that?? What kind of system doesn't have bitwise
operators?

--
Lasse
Jul 19 '05 #2
On Fri, 14 Nov 2003 08:08:18 +0100, "Lasse Skyum" <no spam> wrote:
unsigned char a;
a = a * 16 + a/16;

But why would you want to do that?? What kind of system doesn't have bitwise
operators?


Can you say homework assignment?
M
Jul 19 '05 #3
> Can you say homework assignment?

ahh, right...
Jul 19 '05 #4
aks
nop i suppose it's the question asked in interviews ;)

Lasse Skyum wrote:

unsigned char a;
a = a * 16 + a/16;

But why would you want to do that?? What kind of system doesn't have bitwise
operators?

--
Lasse

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hugh Lutley | last post by:
I'm not much of a programmer so I need a bit of help on this one. I'm writing a Java prog that communticates over rs232 to tape machines and I've got a problem which I'm not sure how to solve. My...
2
by: Hank Reed | last post by:
I found only five small threads discussing Access and EDI and none of them were very recent. Is anyone interfacing with EDI using Access? Can anyone recommend a book that would explain the basics...
8
by: moondaddy | last post by:
I need to convert a byte array to a string and pass it as a parameter in a URL and then convert it back to the original byte array. However, its getting scrambled in the conversion. In short,...
0
by: WideBoy | last post by:
Hi All, I was wondering if any one can point me in the direction of some web resource that fulfills the information I am looking for. Basically, I need some hard evidence of how XML schema and...
2
by: Sam | last post by:
Hello all, Can we interchange the rows & columns of a Datagrid with VB.NET so that all the data that is displayed in rows is displayed as columns? ThanX.
8
by: anirban | last post by:
is it possibe that interchange two no. using only two integer in c not in c++
2
by: Velhari | last post by:
Hi all, In C, I don't know how to shift the nibble.... i.e suppose let us take 'char' data type has 1 byte(8 bits) so to shift the 4 bits to other side and vice versa... Tell me how to...
3
momotaro
by: momotaro | last post by:
am trying to impliment the Interchange trees is this function is correct? int Interchange(Tree *root, Tree **newroot){ Tree *temps; if (root){ temp =...
0
by: =?Utf-8?B?S3VydA==?= | last post by:
I was wondering if anyone knew if there was a simple way to convert a Data Interchange Format (.dif) file (see:http://en.wikipedia.org/wiki/Data_Interchange_Format) into a dataset using the native...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.