Re: bitset in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 09, 2008 at 09:44:38AM +0100, Rudra Banerjee wrote:
> have a C++ program .I am a novice in C 
> 
> #include <bitset>
> #include <iostream>
> 
> int main()
> {
> int i = 23356;
> int j=~i;
> printf("One's complement of i=%u is ~i=%u\n",i,~i);
> std::cout << std::bitset<32>(i);
> printf("\n");
> std::cout << std::bitset<32>(j);
> }is there any equivalent way of bitset in C? or easier way of doing the same thing in C?

There's nothing in the standard library for this, but if you just want
to print the bits of an int this is pretty easy to do from scratch.  Or,
google for any number of existing solutions.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux