
Лекция С++ №1
.pdf
Обращение к полям структуры

Типы данных
|
|
|
|
Количество бит на разных моделях |
|
|||
Специфические типы |
|
Эквивалент |
|
C++ standard |
LP32 |
ILP32 |
LLP64 |
LP64 |
|
|
|
|
|
|
|
|
|
short |
|
|
|
at least |
|
|
|
|
short int |
|
|
|
16 |
|
|
|
|
signed short |
|
|
|
|
|
|
|
|
signed short int |
|
short int |
|
|
|
|
|
|
unsigned short |
|
|
|
|
|
|
|
|
unsigned short int |
|
unsigned short int |
16 |
16 |
16 |
16 |
||
int |
|
|
|
at least |
|
|
|
|
signed |
|
|
|
16 |
|
|
|
|
signed int |
|
int |
|
|
|
|
|
|
unsigned |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int |
|
unsigned int |
16 |
32 |
32 |
32 |
||
long |
|
|
|
at least |
|
|
|
|
long int |
|
|
|
32 |
|
|
|
|
signed long |
|
|
|
|
|
|
|
|
signed long int |
|
long int |
|
|
|
|
|
|
unsigned long |
|
|
|
|
|
|
|
|
unsigned long int |
|
unsigned long int |
32 |
32 |
32 |
64 |
||
long long |
|
long long int |
at least |
|
|
|
||
long long int |
|
|
|
64 |
|
|
|
|
signed long long |
|
|
|
|
|
|
|
|
signed long long int |
|
|
|
|
|
|
|
|
unsigned long long |
unsigned long long int |
|
|
|
|
unsigned long long int |
64 |
64 |
64 |
64 |
1 == sizeof(char) <= sizeof(short) <= sizeof(short) <= sizeof(int)
<= sizeof(int) <= sizeof(long)
<= sizeof(long) <= sizeof(long long)

|
Размер |
|
Диапазон значений |
||||
тип |
в битах Формат |
Приблизительно |
|
Точно |
|||
|
|||||||
char |
|
|
signed |
|
|
|
-128 to 127 |
8unsigned |
|
|
|
0 to 255 |
|||
|
|
|
|
||||
|
|
|
signed |
± 3.27 · 104 |
|
|
-32768 to 32767 |
|
16unsigned |
0 to 6.55 · 104 |
|
|
0 to 65535 |
||
|
|
|
signed |
± 2.14 · 109 |
|
2,147,483,648 to 2,147,483,647 |
|
int |
32unsigned |
0 to 4.29 · 109 |
0 to 4,294,967,295 |
||||
|
|||||||
|
|
|
|
|
|
9,223,372,036,854,775,808 |
|
|
|
|
signed |
± 9.22 · 1018 |
|
|
to 9,223,372,036,854,775,807 |
|
64unsigned |
0 to 1.84 · 1019 0 to 18,446,744,073,709,551,615 |
|||||
float |
|
|
|
± 3.4 · 10± 38 |
min subnormal: ± 1.401,298,4 · 10-47 |
||
|
|
|
|
||||
|
|
|
|
(~7 digits) |
|
|
|
|
32 |
|
|
|
max: ± 3.402,823,4 · 1038 |
||
|
|
|
|
|
min subnormal: ± |
||
|
|
|
|
± 1.7 · 10± 308 |
4.940,656,458,412 · 10-324 |
||
|
|
|
|
(~15 digits) |
|
|
|
|
|
|
|
|
max: ± 1.797,693,134,862,315,7 |
||
|
64 |
|
|
|
· 10308 |
Операторы ввода и вывода cin и cout
-Описаны в стандартной библиотеке std
-cin - объект входного потока пространства имен std
std::cin >> x; // взятие из потока введенное пользователем занчение
-cout - объект выходного потока пространства имен std
std::cout << “выходной поток”; //вывод в поток информацию, т.е. вывести ее пользователю
Что нужно подготовить?!
1. Изучить страницу cppreference.com раздел Fundamental types
2.Изучить материл про ввод и вывод в поток cin и cout
3.Повторить материал про ФУНКЦИИ и
МАССИВЫ