C
Chris Dollin
krisworld said:is this possible to create a variable of 4 bit in C language.
No. Not of /only/ four bits.
(There's bitfields, but lore suggests avoiding them except in
specialised cases.)
An Example shall help me a lot.
Depending on exactly what your actual problem is, you can use
`char` (possibly `signed` or `unsigned`), which will often
waste no more than 4 bits, or you can pack multiple values
into arithmetic variables -- for example, you can fit two
four-bit fields into a `char`, at least four into an `int`,
at least eight into a `long`.