You can have a structure and declare the char array of size 3.
Or best way to create a class, here you can also define custom methods to perform operations on your char array
However you would be far better off just using a 4 byte integer and range checking it before it is used. It is unlikely you will save enough memory by having a 3 byte rather than a 4 byte int to make ashitpro suggestions worth while.
Actually in fairness I have worked with compilers that had 3 byte ints you declared them
long short
or
short long
However as a note to the OP that was most definitely a compiler extension and caused not end of grief when I determined that the clients existing code base was written to a poor standard and attempted to use a static analysis tool on it.
Comment