# Variables

## 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](https://hkust-robotics-team.gitbook.io/hkust-robotics-team-software-tutorial/tutorial/tutorial-0-self-learn-basic-c/basics-of-c/variables/primitive-types) (char, int, float, double)
* [The Boolean Type](https://hkust-robotics-team.gitbook.io/hkust-robotics-team-software-tutorial/tutorial/tutorial-0-self-learn-basic-c/basics-of-c/variables/the-boolean-type) (bool)
* [Standard Integer Types](https://hkust-robotics-team.gitbook.io/hkust-robotics-team-software-tutorial/tutorial/tutorial-0-self-learn-basic-c/basics-of-c/variables/standard-integer-types) (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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hkust-robotics-team.gitbook.io/hkust-robotics-team-software-tutorial/tutorial/tutorial-0-self-learn-basic-c/basics-of-c/variables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
