Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Interchange 2 nibbles of byte

Reply
Thread Tools

Interchange 2 nibbles of byte

 
 
Sreejith K
Guest
Posts: n/a
 
      11-14-2003
How to interchange the two nibbles of a byte without
using any bitwise operator.
 
Reply With Quote
 
 
 
 
Lasse Skyum
Guest
Posts: n/a
 
      11-14-2003
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


 
Reply With Quote
 
 
 
 
Megan
Guest
Posts: n/a
 
      11-14-2003
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
 
Reply With Quote
 
Lasse Skyum
Guest
Posts: n/a
 
      11-14-2003
> Can you say homework assignment?

ahh, right...


 
Reply With Quote
 
aks
Guest
Posts: n/a
 
      11-14-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fast and efficent Huffman coding for nibbles and bytes in C++? 88888 Dihedral C++ 4 02-28-2012 03:40 PM
To and from hex nibbles daniel åkerud Ruby 2 06-10-2008 09:53 AM
Vista DVD 32/64 bit coa interchange? =?Utf-8?B?TGVu?= Windows 64bit 2 02-19-2007 07:20 PM
Concrete example of data interchange using xml document and schema WideBoy XML 0 01-04-2006 10:59 AM
gnuplot parameter interchange Bernhard Hidding C++ 3 06-25-2004 01:51 PM



Advertisments