Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an actual 4-bit integer data type in C++11 [duplicate]

Tags:

c++

c++11

c++14

I require a 4 bit integer in a design for less memory use. In any version of c++ ,c++11 ,c++14 any can be used for the design.

like image 994
Aman Gupta Avatar asked Jun 12 '17 07:06

Aman Gupta


1 Answers

There is no native 4bit datatype. But you could use an 8bit one to hold two 4bit values in the high/low nibble.

like image 141
Jesper Juhl Avatar answered Sep 29 '22 07:09

Jesper Juhl