Skip to content

Data Types

Dylan Tuttle edited this page Sep 17, 2022 · 3 revisions

int

The int data type allows the user to represent a number with no decimal part in code. A single int is signed and occupies 32 bits of space in memory, meaning all numbers within the range $[-2^{31}$, $2^{31} - 1]$ can be represented.

bool

The bool data type allows the user to represent truth values in code. A single bool occupies 32 bits of space (only 1 bit is needed, but space was sacrificed for simplifying compilation) and can only take a value of true or false, which are represented within the compiler as the integers 1 and 0 respectively.

Strings

The string data type allows the user to represent a string of characters in code. String literals can only be used within a call to the printf function, allowing the user to print format strings to the console. Any other use of strings are forbidden.

Clone this wiki locally