> For the complete documentation index, see [llms.txt](https://hkust-robotics-team.gitbook.io/hkust-robotics-team-software-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hkust-robotics-team.gitbook.io/hkust-robotics-team-software-tutorial/tutorial/tutorial-0-self-learn-basic-c/basics-of-c/variables.md).

# Variables

Variables are boxes to save some data

## Data Types

> We have to tell the computer what type of box it is (i.e. how big the box is and what we will put inside it

There are 3 groups of data types:

* [Primitive Types](/hkust-robotics-team-software-tutorial/tutorial/tutorial-0-self-learn-basic-c/basics-of-c/variables/primitive-types.md) (char, int, float, double)
* [The Boolean Type](/hkust-robotics-team-software-tutorial/tutorial/tutorial-0-self-learn-basic-c/basics-of-c/variables/the-boolean-type.md) (bool)
* [Standard Integer Types](/hkust-robotics-team-software-tutorial/tutorial/tutorial-0-self-learn-basic-c/basics-of-c/variables/standard-integer-types.md) (uint8\_t, int64\_t, ...)

### Variable Declaration

> tell the computer the box's name and what we want to put inside

We must tell the computer that we are about to use a variable with some name before we use it. This action is called a **declaration**. And we can only declare a variable with the same name once per scope, (we'll talk about that later). We can declare one with this syntax: `<type> <variable_name>;`. For example:

```c
int some_integer; // Declaring some_integer as a integer
char c; //Declaring c as a character
float f; //Declaring f as a 32-bit, single-precision floating point value
```
