title: Can I implement my own integer arithmetic and integer data types in C?
body: <p>Data types are system depended in C and their bit lengths may change for different machines. I am aware of the &lt; inttypes.h > header which provide fixed width integer datatypes. However, this header guarantee that provided data type has <strong>at least</strong> specified number N of bits. (<a href="http://en.wikipedia.org/wiki/C_data_types" rel="nofollow">Wiki page</a>) </p>
  
  <p>But I need data types with exact bit lengths in my applications. For example, if data type is uint16_t it <strong>should</strong> be 16 bits, not <strong>at least</strong> 16 bits. Now my question is: Can i define new integer data types using "unsigned char" and "char" data types (Since they will be 8 bits in every machine) as main bulding blocks? Can I implement related arithmetic operations and overload arithmetic operators like "+"? Or are there other solutions already?</p>
  
  <p>Edit: My exact problem is about implementations of cryptographic algorithms like DES which require fixed bits. </p>