Bathroom renovation portal. Useful Tips

Basic types of integer data. Floating point types (float, double and long double)

Last update: 13.11.2017

As with many programming languages, C # has its own data type system that is used to create variables. The data type defines the internal representation of the data, the set of values ​​that an object can take, and the valid actions that can be applied to the object.

The C # language has the following primitive data types:

    bool: holds true or false (boolean literals). Represented by the system type System.Boolean

    Bool alive = true; bool isDead = false;

    byte: stores an integer from 0 to 255 and occupies 1 byte. Represented by the system type System.Byte

    Byte bit1 = 1; byte bit2 = 102;

    sbyte: stores an integer from -128 to 127 and takes 1 byte. Represented by the system type System.SByte

    Sbyte bit1 = -101; sbyte bit2 = 102;

    short: stores an integer from -32768 to 32767 and takes 2 bytes. Represented by the system type System.Int16

    Short n1 = 1; short n2 = 102;

    ushort: stores an integer from 0 to 65535 and takes 2 bytes. Represented by the system type System.UInt16

    Ushort n1 = 1; ushort n2 = 102;

    int: stores an integer from -2147483648 to 2147483647 and takes 4 bytes. Represented by the system type System.Int32. All integer literals represent int values ​​by default:

    Int a = 10; int b = 0b101; // binary form b = 5 int c = 0xFF; // hexadecimal form c = 255

    uint: stores an integer from 0 to 4294967295 and takes 4 bytes. Represented by the system type System.UInt32

    Uint a = 10; uint b = 0b101; uint c = 0xFF;

    long: stores an integer from –9 223 372 036 854 775 808 to 9 223 372 036 854 775 807 and occupies 8 bytes. Represented by the system type System.Int64

    Long a = -10; long b = 0b101; long c = 0xFF;

    ulong: stores an integer from 0 to 18 446 744 073 709 551 615 and occupies 8 bytes. Represented by the system type System.UInt64

    Ulong a = 10; ulong b = 0b101; ulong c = 0xFF;

    float: stores a floating point number from -3.4 * 10 38 to 3.4 * 10 38 and takes 4 bytes. Represented by the system type System.Single

    double: stores a floating point number from ± 5.0 * 10 -324 to ± 1.7 * 10 308 and occupies 8 bytes. Represented by the system type System.Double

    decimal: stores a decimal fractional number. If used without a decimal point, it has a value from ± 1.0 * 10 -28 to ± 7.9228 * 10 28, can store 28 decimal places and takes 16 bytes. Represented by the system type System.Decimal

    char: stores a single Unicode character and takes 2 bytes. Represented by the system type System.Char. Character literals correspond to this type:

    Char a = "A"; char b = "\ x5A"; char c = "\ u0420";

    string: stores the Unicode character set. Represented by the system type System.String. Character literals correspond to this type.

    String hello = "Hello"; string word = "world";

    object: can store a value of any data type and is 4 bytes on a 32-bit platform and 8 bytes on a 64-bit platform. Represented by the system type System.Object, which is the base type for all other .NET types and classes.

    Object a = 22; object b = 3.14; object c = "hello code";

For example, let's define several variables of different types and print their values ​​to the console:

Using System; namespace HelloApp (class Program (static void Main (string args) (string name = "Tom"; int age = 33; bool isEmployed = false; double weight = 78.65; Console.WriteLine ($ "Name: (name)"); Console.WriteLine ($ "Age: (age)"); Console.WriteLine ($ "Weight: (weight)"); Console.WriteLine ($ "Works: (isEmployed)");)))

To output data to the console, interpolation is used here: a $ sign is placed in front of the string, and after that we can enter the values ​​of variables in the string in curly braces. Console output of the program:

Name: Tom Age: 33 Weight: 78.65 Worked: False

Using suffixes

When assigning values, keep in mind the following subtlety: all real literals are treated as double values. And to indicate that a fractional number represents a float or a decimal type, you need to add a suffix to the literal: F / f for float and M / m for decimal.

Likewise, all integer literals are treated as int values. To explicitly indicate that an integer literal represents a uint value, you must use the U / u suffix, long with the L / l suffix, and ulong with the UL / ul suffix:

Uint a = 10U; long b = 20L; ulong c = 30UL;

Using system types

Above, when listing all the basic data types, the system type was mentioned for each. Because the name of a built-in type is essentially an abbreviation for a system type. For example, the following variables will be equivalent in type:

Int a = 4; System.Int32 b = 4;

Implicit typing

Earlier, we explicitly specified the type of variables, for example, int x; ... And the compiler already knew at startup that x stores an integer value.

However, we can use the implicit typing model as well:

Var hello = "Hell to World"; var c = 20; Console.WriteLine (c.GetType (). ToString ()); Console.WriteLine (hello.GetType (). ToString ());

For implicit typing, the var keyword is used instead of the data type name. Then, during compilation, the compiler itself infers the data type based on the assigned value. The above example used the expression Console.WriteLine (c.GetType (). ToString ()); which allows us to find out the inferred type of the variable c. Since by default all integer values ​​are considered to be of type int, so in the end the variable c will be of type int or System.Int32

These variables are similar to normal variables, but they have some limitations.

First, we cannot first declare an implicitly typed variable and then initialize:

// this code works int a; a = 20; // this code doesn't work var c; c = 20;

Second, we cannot specify null as the value of an implicitly typed variable:

// this code doesn't work var c = null;

Since the value is null, the compiler cannot infer the data type.

double or decimal

From the above list of data types, it is obvious that if we want to use numbers up to 256 in the program, then we can use variables of the byte type to store them. When using large values, we can take the types short, int, long. The same is for fractional numbers - for ordinary fractional numbers you can take the float type, for very large fractional numbers - the double type. The decimal type stands out here in the sense that, despite the large bit depth compared to the double type, the double type can store a larger value. However, a decimal value can contain up to 28 decimal places, while a double value can be 15-16 decimal places.

Decimal is more commonly used in financial calculations, while double is used in mathematical operations. The general differences between the two types can be summarized in the following table.

Answer:
  1. Integer data types:

short int, unsigned short int, int, unsigned int, long, unsigned long.

  1. Floating point data types (correspond to real types):

float, double, long double.

  1. Character data type:

char (signed char), unsigned char, wchar_t.

  1. Boolean data type:

bool.

  1. Enumerated data type (introduced in Visual C ++):

enum.

2. What are the features of using integer data types?

In C ++, the basic integer data types are: short int, unsigned short int, int, unsigned int, long (long int), unsigned long (unsigned long int).

These data types represent values ​​from a variety of integers. For instance:

2 -100 398

Data types that begin with the unsigned prefix can only contain positive numbers.

Data of type short int, unsigned short int occupy two times less memory space than data of type int, unsigned int.

Data of type long, unsigned long occupy twice as much memory space as data of type int, unsigned int.

3. How to describe a variable named x of integer type in a program?

Answer:
int x; // signed integer

As a result, under the variable x memory space of 4 bytes will be allocated. The size of the memory that is allocated for the variable depends on the characteristics of the computer, the type of operating system and the compiler settings.

4. How to write the number 239 into a variable of an integer type?

To do this, use the assignment operator, which is denoted by the symbol '='.

Answer 1. Entering a number into a variable after its description.

int x; x = 239;

Answer 2. Entering a number into a variable during its declaration (initial initialization).

int x = 239;

5. What are the features of floating point data types?

Floating point data types are allowed to represent values ​​from a set of real numbers. For instance:

8.35 -990.399 239.0.

C ++ has the following basic floating point data types: float, double, long double.

A double variable takes up 2 times more space in the computer memory than a float variable.

Also, a variable of the long double type takes 2 times more space in the computer memory than a variable of the double type.

6. How to describe a variable that takes a floating point value?

An example of describing variables of type float, double, long double:

float f; double d; long double ld;

7. How to write numeric values ​​to a floating point variable?

An example of entering numeric data into variable types with floating point:

float f = -9928.45; // initial initialization double d; long double ld; d = 0.445332; // assignment operator ld = 3892923898239.030903; // assignment operator

8. How to convert a variable of type float to type int?

For this, the operation of type casting is used. In brackets, you need to indicate the name of the type to which the conversion is taking place.

float a; int b; a = 8.457; b = (int) a; // b = 8

When using type casting operations, you need to take into account the restrictions that are imposed on types that take up less space in the computer's memory.

For example, a variable of type short int can represent a smaller range of numbers than variables of types float, double. In the following listing, a value overflow occurs in a variable of type short int:

short int i; float f; f = 3990099.8; i = (int) f; // i = -7597 - overflow

9. How to convert a variable from type int to type double?

An example of casting from int to double:

int i; double d; i = 982; d = (double) i; // d = 982.0

10. What are the features of using char data (character data) in a program?

The char data represents the character value of the code entered from the keyboard. The character code is an integer.

For example, the character code for 'f' is 102.

A snippet of code in which the character code is calculated:

int code; char symbol; symbol = "f"; code = (int) symbol; // code = 102

The char data are the same integers. Char data occupy 1 byte in the computer memory.

The character-to-code relationship is located in the Windows character table. Characters with codes 0 through 127 are BIOS reserved characters. They include the most commonly used symbols, numeral symbols, symbols of the Latin alphabet. These symbols cannot be changed.

Characters with codes from 128 to 255 are regional characters that are tied to the specific alphabet of the computer on which the Windows operating system is installed.

11. What are the features of using data of type bool (logical type)?

Variables of type bool can take only two values:

true - true,

false is false.

These variables are used to test boolean expressions. The numeric value true is 1. The numeric value false is 0.

A snippet of code that defines the numeric values ​​true and false:

int result; bool b; result = (int) true; // result = 1 b = false; result = (int) b; // result = 0

A snippet of code that converts int and float types to bool:

int i; float f; bool b; i = 6; b = (bool) i; // b = True f = 0.0; b = (bool) f; // b = False

12. How to determine the size of memory occupied by a variable of a given type?

The sizeof () operation is used for this.

A snippet of code that determines the size of some data types:

int d; d = sizeof (char); // d = 1 d = sizeof (unsigned int); // d = 4 d = sizeof (float); // d = 4 d = sizeof (double); // d = 8

13. How are variables of different types initialized?

int d = 28; float z = (float) 2.85; char c = "k"; String ^ s = "Hello!" ; double r = -8.559;

14. How to determine the maximum allowable (minimum allowable) value of a variable of a certain type?

The .NET Framework uses the MaxValue and MinValue properties to determine the maximum or minimum acceptable value for a variable of a certain type.

Examples of determining the limit values ​​of variables of different types.

For variables of type int:

// int type int i; long MaxInt; long MinInt; MaxInt = (long) i.MaxValue; // MaxInt = 2147483647 MinInt = (long) i.MinValue; // MinInt = -2147483648

For variables of type short int:

// short int type short int si; int MaxInt; int MinInt; MaxInt = (int) si.MaxValue; // MaxInt = 32767 MinInt = (int) si.MinValue; // MinInt = -32768

For variables of unsigned int type:

// unsigned int type unsigned int ui; unsigned int MaxInt; unsigned int MinInt; MaxInt = ui.MaxValue; // MaxInt = 4294967295 MinInt = ui.MinValue; // MinInt = 0

For float variables:

// float type float f; float MaxF; float MinF; MaxF = f.MaxValue; // MaxF = 3.402823E + 38 MinF = f.MinValue; // MinF = -3.402823E + 38

For variables of type double:

// double type double d; double MaxD; double MinD; Max = d.MaxValue; // Max = 1.79769313486232E + 308 Min = d.MinValue; // Min = -1.79769313486232E + 308

For variables of type char:

// char type char c; int MaxC; int MinC; Max = (int) c.MaxValue; // Max = 127 Min = (int) c.MinValue; // Min = -128

15. What are the features of using the enum type?

The enum type is an enumerated data type. It specifies mnemonic values ​​for sets of integer values. Each mnemonic meaning has a specific content and is represented by an integer.

An example of using the enum type to represent the months of the year:

enum months (January, February, March, April, May, June, July, August, September, October, November, December) mn; mn = January; // mn = 0 mn = March; // mn = 2 mn = September; // mn = 8

The given example describes a variable named mn of type enum months. Mnemonic values ​​for months (January, February,…) start at 0 (0, 1, 2,…). The mnemonic January is the integer 0, the mnemonic February is the integer 1, and so on.

So, using the enum type, you can use mnemonic notations in the program text for better clarity of the source code.

You can also write this:

mn = (enum months) 2; // mn = March mn = (enum months) 11; // mn = December

16. What are the features of the application of the typevoid in programs forC++ ?

The void data type is used in the following cases:

  • if you need to describe a function that does not return any value (see example);
  • if you need to describe a function that does not receive parameters (see example).

Example... The MyFun () function without parameters, which does not return any value (returns the void type) and does not receive parameters.

public: void MyFun (void) { // function body // ... return; // return from a function that does not return a value } // call the function from the program ... MyFun (); ...

17. Is it possible to declare a variable of typevoid in a programme?

It is impossible, since the void type is not associated with a value.

Declaring a variable of type void leads to a compilation error with the output of the message:

"Illegal use of type void"

18. What are the features of the application of the typewchar_ t vVisual C++ ?

Variables of type char (see previous points) are used to store 8-bit ASCII characters.

The wchar_t type is used to store characters that are part of large character sets. For example, the Chinese alphabet has a huge number of characters. 8 bits is not enough to represent the entire character set of the Chinese alphabet. Therefore, if you need to use the program in the international market, it is advisable to replace the char type with wchar_t.

Example using the wchar_t type.

... wchar_t t; // 2 bytes of memory are allocated for the t variable t = "s"; ...

In the C language, the concepts of "data type" and "type modifier" are distinguished. The data type is integer and the modifier is signed or unsigned. A signed integer will have both positive and negative values, and an unsigned integer will only have positive values. There are five basic types in the C language.

  • char is character.
  • A variable of the char type has a size of 1 byte, its values ​​are various characters from the code table, for example: ‘’, ‘:’, ‘j’ (when written in a program, they are enclosed in single quotes).

  • int is an integer.
  • The size of a variable of type int is not defined in the C standard. In most programming systems, the size of a variable of type int corresponds to the size of an entire machine word. For example, in compilers for 16-bit processors, an int variable is 2 bytes in size. In this case, the signed values ​​of this variable can range from -32768 to 32767.

  • float is real.
  • The float keyword allows you to define variables of a real type. Their values ​​have a fractional part, separated by a dot, for example: -5.6, 31.28, etc. Real numbers can also be written in floating point form, for example: -1.09e + 4. The number before the "e" is called the mantissa, and after the "e" - the order. A float variable occupies 32 bits in memory. It can take values ​​in the range from 3.4e-38 to 3.4e + 38.

  • double - double precision real;
  • The double keyword allows you to define a double precision real variable. It takes up twice as much memory space as a float variable. A variable of the double type can take values ​​in the range from 1.7e-308 to 1.7e + 308.

  • void is irrelevant.
  • The void keyword is used to neutralize the value of an object, for example, to declare a function that does not return any values.

Variable types:

Programs operate with a variety of data, which can be simple and structured. Simple data are integers and real numbers, symbols and pointers (addresses of objects in memory). Integers do not have, and real numbers have a fractional part. Structured data are arrays and structures; they will be discussed below.

A variable is a location in the computer's memory that has a name and stores some value. The value of a variable can change during program execution. When writing a new value to a cell, the old one is erased.

It is good style to name your variables meaningfully. A variable name can contain from one to 32 characters. It is allowed to use lowercase and uppercase letters, numbers and the underscore character, which is considered a letter in C. The first character must be a letter. Variable name cannot match reserved words.

Char type

char is the most economical type. The char type can be signed or unsigned. It is denoted as “signed char” (signed type) and “unsigned char” (unsigned type). A signed type can store values ​​in the range -128 to +127. Unsigned - from 0 to 255. A variable of the char type is allocated 1 byte of memory (8 bits).

The signed and unsigned keywords indicate how the zero bit of the declared variable is interpreted, i.e., if the unsigned keyword is specified, then the zero bit is interpreted as part of the number, otherwise the zero bit is interpreted as signed.

Int type

An integer value int can be short or long. The short keyword is placed after the signed or unsigned keywords. Thus, there are types: signed short int, unsigned short int, signed long int, unsigned long int.

A variable of type signed short int (signed short integer) can take values ​​from -32768 to +32767, unsigned short int (unsigned short integer) - from 0 to 65535. Exactly two bytes of memory (16 bits) are allocated for each of them.

When declaring a variable of type signed short int, the keywords signed and short can be omitted, and such a variable can be declared as simply int. It is also allowed to declare this type with one short keyword.

The variable unsigned short int can be declared as unsigned int or unsigned short.

4 bytes of memory (32 bits) are allocated for each signed long int or unsigned long int value. The values ​​of variables of this type can range from -2147483648 to 2147483647 and from 0 to 4294967295, respectively.

There are also variables of type long long int, for which 8 bytes of memory (64 bits) are allocated. They can be signed or unsigned. For a signed type, the range of values ​​lies in the range from -9223372036854775808 to 9223372036854775807, for an unsigned type - from 0 to 18446744073709551615. A signed type can be declared simply with two long long keywords.

A type Range Hexadecimal Range The size
unsigned char 0 … 255 0x00 ... 0xFF 8 bit
signed char
or simply
char
-128 … 127 -0x80 ... 0x7F 8 bit
unsigned short int
or simply
unsigned int or unsigned short
0 … 65535 0x0000 ... 0xFFFF 16 bit
signed short int or signed int
or simply
short or int
-32768 … 32767 0x8000 ... 0x7FFF 16 bit
unsigned long int
or simply
unsigned long
0 … 4294967295 0x00000000 ... 0xFFFFFFFF 32 bit
signed long
or simply
long
-2147483648 … 2147483647 0x80000000 ... 0x7FFFFFFF 32 bit
unsigned long long 0 … 18446744073709551615 0x0000000000000000 ... 0xFFFFFFFFFFFFFFFF 64 bit
signed long long
or simply
long long
-9223372036854775808 … 9223372036854775807 0x8000000000000000 ... 0x7FFFFFFFFFFFFFFF 64 bit

Declaring Variables

Variables are declared in a declaration statement. The declaration statement consists of a type specification and a comma-separated list of variable names. There must be a semicolon at the end.

[modifiers] type_qualifier id [, id] ...

Modifiers - keywords signed, unsigned, short, long.
The type specifier is a char or int keyword that defines the type of the variable being declared.
The identifier is the name of the variable.

Char x; int a, b, c; unsigned long long y;

When declaring a variable, you can initialize, that is, assign an initial value to it.

Int x = 100;

When declared, the number 100 will be immediately written to the x variable. It is better to declare the initialized variables in separate lines.

In this tutorial, you will learn C ++ alphabet and also what data types can be processed by the program on it. Perhaps this is not the most exciting moment, but this knowledge is necessary! In addition, starting to learn any other programming language, you will more confidently go through a similar stage of learning. A C ++ program can contain the following characters:

  • uppercase, lowercase Latin letters A, B, C…, x, y, z and underscore;
  • Arabic numerals from 0 to 9;
  • special characters: (), | , () + - /% *. \ ‘:?< > = ! & # ~ ; ^
  • space, tab, and newline characters.

In the program test, you can use comments... If text with two forward slashes // and ends with a newline character or is enclosed between / * and * /, the compiler ignores it.

Data in C ++

To solve a problem in any program, any data is processed. They can be of various types: integers and real numbers, symbols, strings, arrays. It is customary to describe data in C ++ at the beginning of a function. TO basic data types language include:

For the formation of other types of data, basic and so-called specifiers. C ++ defines four data type specifiers:

  • short - short;
  • long - long;
  • signed - signed;
  • unsigned - unsigned.

Integer type

Variable of type int in computer memory it can take either 2 or 4 bytes. It depends on the bitness of the processor. By default, all integer types are considered signed, that is, the specifier signed can be omitted. The specifier unsigned allows only positive numbers to be represented. Below are some ranges of integer values

A type Range The size
int -2147483648…2147483647 4 bytes
unsigned int 0…4294967295 4 bytes
signed int -2147483648…2147483647 4 bytes
short int -32768…32767 2 bytes
long int -2147483648…2147483647 4 bytes
unsigned short int 0…65535 2 bytes

Real type

A floating point number is represented in the form mE + - p, where m is the mantissa (integer or fractional number with a decimal point), p is the order (integer). Usually values ​​like float occupy 4 bytes, and double 8 bytes. Real range table:

float 3.4E-38 ... 3.4E + 38 4 bytes
double 1.7E-308 ... 1.7E + 308 8 bytes
long double 3.4E-4932 ... 3.4E + 4932 8 bytes

Boolean type

Variable of type bool can only take two values true ( true ) or fasle ( Lying ). Any value other than zero is interpreted as true. Meaning false represented in memory as 0.

Void type

Many values ​​of this type are empty. It is used to define functions that do not return a value, to specify an empty function argument list, as a base type for pointers, and in casting operations.

Data type conversion

C ++ distinguishes between two types of data type conversion: explicit and implicit.

  • Implicit conversion happens automatically. This is done during comparison, assignment, or evaluation of expressions of different types. For example, the following program will print to the console a value like float.

#include "stdafx.h" #include using namespace std; int main () (int i = 5; float f = 10.12; cout<> void "); return 0;)

#include "stdafx.h"

#include

using namespace std;

int main ()

int i = 5; float f = 10.12;

cout<< i / f ;

system ("pause >> void");

return 0;

The type with the least information loss is given the highest priority. You should not abuse implicit type conversion, as all sorts of unexpected situations may arise.

  • Explicit conversion as opposed to implicitly done by the programmer. There are several ways to do this:
  1. Converting to Styles C: (float) a
  2. Converting to Styles C ++: float ()

Also, type conversions can be performed using the following operations:

static_cast<>() const_cast<>() reinterpret_cast<>() dynamic_cast<> ()

static_cast<> ()

const_cast<> ()

reinterpret_cast<> ()

dynamic_cast<> ()

static_cas- performs conversion of related data types. This operator casts types according to the usual rules, which may be required when the compiler does not perform automatic conversion. The syntax will look like this:

Static_cast type<Тип>(an object);

Using static_cast, you cannot remove constness from a variable, but this is within the power of the following statement. const_cast- it is used only when it is necessary to remove the constants from the object. The syntax will look like this:

A typeconst_cast< A type> (an object);

reinterpret_cast- is used to convert different types, integers to a pointer and vice versa. If you see the new word "pointer" - don't be alarmed! this is also a data type, but we will not work with it soon. The syntax here is the same as for the previously considered operators:

A typereinterpret_cast< A type> (an object);

dynamic_cast- is used for dynamic type conversion, implements the casting of pointers or links. Syntax:

A typedynamic _cast< A type> (an object);

Control characters

You are already familiar with some of these "control characters" (for example, with \ n). They all start with a backslash and are also surrounded by double quotes.

Image

Hexadecimal code

Name

Beeper sound

Backtrack

Translation of the page (format)

Line translation

Carriage return

Horizontal tab

Vertical tab

All data in the C language has its own type. Variables of certain types occupy some place in memory, which is different depending on the type. In C, there is no clear assignment of the amount of memory to certain types. This is given to the implementation of a specific compiler for a specific platform. For example, a variable like int in one compiler it can occupy 16 bits in memory, in another - 32 bits, in the third - 8 bits. Everything is determined by a specific compiler. True, everyone strives for universalization, and basically in most compilers the type int , for example, takes 2 bytes, and the type char - one.

I got a bit dull lately, couldn't remember how many bytes the type takes double v AVR-GCC... Usually, when programming controllers, you work with integer types, such as int and char , and you do not often resort to floating-point types, due to their resource consumption.

Therefore, for the future, I will leave a memo for myself here indicating the size of the memory occupied by data types for the AVR-GCC compiler and the range of change of variables of this type.

C data types for the AVR-GCC compiler

A type Size in
bytes (bits)
Change interval
char 1 (8) -128 .. 127
unsigned char 1 (8) 0 .. 255
signed char 1 (8) -128 .. 127
int 2 (16) -32768 .. 32767
unsigned int 2 (16) 0 .. 65535
signed int 2 (16) -32768 .. 32767
short int 2 (16) -32768 .. 32767
unsigned short int 2 (16) 0 .. 65535
signed short int 2 (16) -32768 .. 32767
long int 4 (32) -2147483648 .. 2147483647
unsigned long int 4 (32) 0 .. 4294967295
signed long int 4 (32) -2147483648 .. 2147483647
float 4 (32) 3.4E-38 .. 3.4E + 38
double 4 (32) 3.4E-38 .. 3.4E + 38
long double 10 (80) 3.4Е-4932 .. 3.4Е + 4932

Type implementation double the AVR-GCC deviates from the standard. Standard double takes 64 bits. In AVR-GCC, a variable of this type occupies 32 bits, and, accordingly, it is equivalent to a variable with the type float!

In addition to this, the AVR-GCC libraries have introduced several derivatives of the standard types. They are described in the file stdint.h ... This was done, probably, to improve the clarity and reduce the text of programs (speed up their writing :)). Here is the compliance table:

Types derived from the standard types in the C language for the AVR-GCC compiler

Derived type Standard type
int8_t signed char
uint8_t unsigned char
int16_t signed int
uint16_t unsigned int
int32_t signed long int
uint32_t unsigned long int
int64_t signed long long int
uint64_t unsigned long long int

Void type

There is another type in the C language - the type void . Void is used to indicate that the function does not return anything as a result, or does not take any parameters as input. This type is not used to declare variables, so it does not take up memory space.