Signed char

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{FormatInfo | name = signed char | formattype = electronic | subcat = Data types | subcat2 = C++ data types | subcat3 = | subcat4 ...")
 
(released)
 
(One intermediate revision by one user not shown)
Line 16: Line 16:
 
| uniform type  =
 
| uniform type  =
 
| conforms to    =  
 
| conforms to    =  
| released      =
+
| released      = 1983
 
| image          =  
 
| image          =  
 
| caption        =  
 
| caption        =  
Line 33: Line 33:
 
| 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0
 
| 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0
 
|}
 
|}
 
==Relationship with char==
 
'''signed char''' uses exact same amount of memory as '''char''', the main difference happens during the output; '''char''' gets interpreted as the code of [[ASCII]] character, while '''signed char''' is interpreted as [[two's complement]] signed integer.
 
  
 
==Other C++ datatypes of the same size==
 
==Other C++ datatypes of the same size==

Latest revision as of 07:04, 13 May 2015

File Format
Name signed char
Ontology
Released 1983


signed char is the smallest signed integer type in C++, it often gets typedef-ed as "byte" (alternatively people use unsigned char for that reason) because it uses one byte of memory (depending upon what architecture defines it as, but no less than 8 bits). The range of values that can definitely be stored in this type is -128 – 127.

7 6 5 4 3 2 1 0 value
1 0 0 0 0 0 0 0 -128
0 1 1 1 1 1 1 1 127
0 0 0 0 0 0 0 0 0

[edit] Other C++ datatypes of the same size

[edit] Other C++ data types storing signed integers

  • short no less than 16 bits, no less than char
  • int no less than 16 bits, no less than short
  • long no less than 32 bits, no less than int
  • long long no less than 64 bits, no less than long
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox