Category:C: Difference between revisions

No edit summary
Line 116:
 
===Types===
C has the following types built in by default, but you can create your own based on these using the <code>typedef</code> directive. This is not an exhaustive list.
* <code>char</code>: an 8 bit value, typically used to represent ASCII characters.
* <code>short</code>: a 16 bit value.
* <code>int</code>: a 32 bit value.
* <code>struct</code>: a collection of several other values, stored consecutively in memory. Each can be a different type.
* <code>union</code>: a variable that can hold several different types of data, but only one at a time.
* <code>float</code>: a floating-point decimal value.
 
You can also add a few modifiers in front of the variable type to be more specific:
1,489

edits