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.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Queries for count of array elements with values in given range with updates
- Difference between Identifiers and Variables in C
- Sum of first N natural numbers with all powers of 2 added twice
- Difference between C and Objective C
- Sum of Hamming difference of consecutive numbers from 0 to N | Set 2
- First number to leave an odd remainder after repetitive division by 2
- Construct the smallest possible Array with given Sum and XOR
- Strict Aliasing Rule in C with Examples
- Difference between cout and puts() in C++ with Examples
- Difference between forward list and list in C++
- Short-Circuiting in C++ and Linux
- XOR of a subarray (range of elements) | Set 2
- Different types of range-based for loop iterators in C++
- Maximum bitwise OR value of subsequence of length K
- Learn C++ Programming Step by Step - A 20 Day Curriculum!