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.
- C program to print characters without using format specifiers
- Array sum in C++ STL
- Output of C programs | Set 63
- Find One's Complement of an Integer
- Bits manipulation (Important tactics)
- Array of Strings in C++ (3 Different Ways to Create)
- std::tuple, std::pair | Returning multiple values from a function using Tuple and Pair in C++
- Vector in C++ STL
- Basic Concepts of Object Oriented Programming using C++
- Arrays in C/C++
- C Language Introduction
- Static data members in C++
- const_cast in C++ | Type Casting operators
- Memory Layout of C Programs
- Pre-increment (or pre-decrement) in C++