QP School
Storing an integer in C - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: C 18 Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=32)
+--- Thread: Storing an integer in C (/showthread.php?tid=5140)



Storing an integer in C - Qomplainerz - 07-26-2023

Description:

The int data type in C is used to store whole numbers (integers). It typically occupies 4 bytes of memory (though the size can vary depending on the system), and it can represent both positive and negative values.

Example:

int num = 42;

Explanation:

In this example, we declare a variable num of type int.
We initialize it with the value 42.
The int data type can store integer values within the range of -2,147,483,648 to 2,147,483,647 (on most systems).