Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Bit swapping

Answer Posted / sibnath halder

Assuming that you want to use 8 bits of whatever bytes you
have, you could use

char swapbyte(unsigned char c)
{ unsigned char result=0;
for(int i=0;i<8;++i)
{ result=result<<1;
result|=(c&1);
c=c>>1;
}
return result;
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a Program to accept different goods with the number, price and date of purchase and display them

6237


How many bytes are occupied by near, far and huge pointers (dos)?

1154


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

2311


What is the use of typedef in structure in c?

970


Write a factorial program using C.

1082


A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

2318


how to find binary of number?

4453


What do you mean by dynamic memory allocation in c?

1105


Can the curly brackets { } be used to enclose a single line of code?

1173


Explain how can I manipulate strings of multibyte characters?

1206


How many keywords are there in c?

1078


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

2021


What are the main characteristics of c language describe the structure of ac program?

1212


Write a program of advanced Fibonacci series.

1149


What is a class c rental property?

1094