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 email@example.com. 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.
- Difference between pointer to an array and array of pointers
- OR Gate using Perceptron Network
- Sum of Bitwise OR of all pairs in a given array
- PImpl Idiom in C++ with Examples
- Maximum subset sum such that no two elements in set have same digit in them
- dot (.) operator in C/C++
- Features and Use of Pointers in C/C++
- Count pairs of elements such that number of set bits in their AND is B[i]
- Number of 0s and 1s at prime positions in the given array
- Difference between while and do-while loop in C, C++, Java
- Find uncommon characters of the two strings | Set 2
- C program to sort an array using pointers
- C Program to count the Number of Characters in a File
- Analyzing BufferOverflow with GDB
- boost::algorithm::any_of_equal() in C++ library