473,405 Members | 2,176 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,405 software developers and data experts.

reverse all the bits in a unsigned integer

.. How to reverse all the bits in a unsigned integer? an signed
integer (you have to keep the sign of the integer)?

Mar 22 '07 #1
6 3098
* hijkl:
. How to reverse all the bits in a unsigned integer? an signed
integer (you have to keep the sign of the integer)?
Check out the FAQ's solutions to homework problems.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Mar 22 '07 #2
On Mar 21, 7:06 pm, "Alf P. Steinbach" <a...@start.nowrote:
* hijkl:
. How to reverse all the bits in a unsigned integer? an signed
integer (you have to keep the sign of the integer)?

Check out the FAQ's solutions to homework problems.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Hi Alf,
what is that?? i didnt get you :)

Mar 22 '07 #3

"hijkl" <s_******@yahoo.comwrote in message
news:11**********************@p15g2000hsd.googlegr oups.com...
On Mar 21, 7:06 pm, "Alf P. Steinbach" <a...@start.nowrote:
>* hijkl:
. How to reverse all the bits in a unsigned integer? an signed
integer (you have to keep the sign of the integer)?

Check out the FAQ's solutions to homework problems.

Hi Alf,
what is that?? i didnt get you :)
Alf is saying we won't do your homework for you. However, I will point you
in the right direction. If you want to reverse the bits, look at xor
(exclusive or).
Mar 22 '07 #4
On Mar 22, 11:01 am, "hijkl" <s_mah...@yahoo.comwrote:
. How to reverse all the bits in a unsigned integer? an signed
integer (you have to keep the sign of the integer)?
Learn yourself abuot bitwise operators. :)

Mar 22 '07 #5
On Mar 21, 7:33 pm, "Sarath" <CSar...@gmail.comwrote:
On Mar 22, 11:01 am, "hijkl" <s_mah...@yahoo.comwrote:
. How to reverse all the bits in a unsigned integer? an signed
integer (you have to keep the sign of the integer)?

Learn yourself abuot bitwise operators. :)
hey guys
this is not homework questions :) ..
i was preparing for interview. i founf these questions on net :)
here is a link
http://www.aceemploymentservices.net...ions.htm#think
and some other links..
i am done with studies guys
ok have a fun

Mar 22 '07 #6
On 22 Mar, 06:47, "hijkl" <s_mah...@yahoo.comwrote:
On Mar 21, 7:33 pm, "Sarath" <CSar...@gmail.comwrote:
On Mar 22, 11:01 am, "hijkl" <s_mah...@yahoo.comwrote:
. How to reverse all the bits in a unsigned integer? an signed
integer (you have to keep the sign of the integer)?
Learn yourself abuot bitwise operators. :)

hey guys
this is not homework questions :) ..
i was preparing for interview. i founf these questions on net :)
here is a linkhttp://www.aceemploymentservices.net/Articles/Interviewers/Microsoft%...
and some other links..
We define homework as anything where you want other people to solve or
figure out simple things for you.

--
Erik Wikström

Mar 22 '07 #7

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

Similar topics

47
by: Kapil Khosla | last post by:
Hi, I am trying to reverse a byte eg. 11010000 should look like 00001011 Plz note, it is not a homework problem and I do not need the c code for it. Just give me an idea how should I proceed...
7
by: Digital Puer | last post by:
I'd like to be able to create an integer from a range of contiguous bits in another integer. I'm on a big-ending machine, in case that matters. I would ideally like to create a function with this...
40
by: Allan M. Bruce | last post by:
I am applying for my first jobs after completing my PhD. I have been asked by a company to go and take a C programming test to see how my C skills are. Apparantly this test is mostly finding...
13
by: Tomás | last post by:
The quantity of bits used by an unsigned integer type in memory can be determined by: typedef unsigned long long UIntType; CHAR_BIT * sizeof(UIntType) However, what would be a good...
12
by: Frederick Gotham | last post by:
Over on comp.lang.c, Hallvard B Furuseth devised a compile-time constant representing the amount of value representation bits in an unsigned integer type. In true C fashion, here it is as a macro:...
34
by: Cuthbert | last post by:
Hi folks, I am trying to find a more efficient way to count "How many bits are '1' in a integer variable?". I still have no idea to count the bits except using a loop and "if" statements....
20
by: mike7411 | last post by:
Is there any easy way to reverse the order of the bits in a byte in C++? (i.e. 00000001 becomes 10000000)
40
by: KG | last post by:
Could any one tell me how to reverse the bits in an interger?
25
by: Daniel Kraft | last post by:
Hi, I do need to implement something similar to C++'s std::bitset in C; for this, I use an array of int's to get together any desired number of bits, possibly larger than 32/64 or anything like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.