Olaf El Blanco wrote:
> How many bits we need to save the "number" 1 in a C text file?
Please clarify what you mean by the above, and also how it relates to
the subject. Particularly, what do you mean by "number"? A `int`, a
`short int`, a `long`, a `double`?
sizeof(char) == 1
Always, by definition (C refers to it as 1 byte). The number of bits in
a byte depends on the implementation, and is found in <limits.h> in a
macro CHAR_BIT (the minimum required is

.
> 00000001? 1 byte?
> And the "number" 12? Is also a byte? 00001100?
> And the "number" 300?
I don't know whether this is what you're looking for, but in C, all
undecorated integer constants are of type `int`. The range you can
store in an `int` is also found in <limits.h> (INT_MIN and INT_MAX).
How many bytes you need to store an `int`, you'll find if you evaluate:
sizeof(int)
So, 1, 12, and 300, as shown above will all take `sizeof(int)` bytes to
store.