CHAR_BIT : It is the number of bits in char. These days, almost all architectures use 8 bits per byte (But it is not the case always, some older machines used to have 7-bit byte). It can be found in
Let us see an application of it. Suppose we wish to print byte by byte representation of an integer.
Input : 4 Output : 00000000 00000000 00000000 00000100 Input : 12 Output : 00000000 00000000 00000000 00001100
00000000 00000000 00000000 00001100
This article is contributed by Apurva Agarwal. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Count Set-bits of number using Recursion
- Count smaller elements on right side and greater elements on left side using Binary Index Tree
- Equal Sum and XOR of three Numbers
- time.h header file in C with Examples
- C++ program to compare two Strings using Operator Overloading
- not1 and not2 function templates in C++ STL with Examples
- Find the number of pair of Ideal nodes in a given tree
- Bit manipulation | Swap Endianness of a number
- Find two integers A and B such that A ^ N = A + N and B ^ N = B + N
- Go vs C++
- Quadruplet pair with XOR zero in the given Array
- Trie Data Structure using smart pointer and OOP in C++
- std::hash class in C++ STL
- Find maximum xor of k elements in an array
- History of C++