-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchar_example1.cpp
More file actions
27 lines (22 loc) · 985 Bytes
/
Copy pathchar_example1.cpp
File metadata and controls
27 lines (22 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
int main()
{
char character1{'D'};
char character2{'A'};
char character3{'C'};
char character4{'F'};
std ::cout << character1 << std::endl;
std ::cout << character2 << std ::endl;
std ::cout << character3 << std ::endl;
std ::cout << character4 << std ::endl;
// one byte in memory = 256 different values (0 - 255)
// standard ASCII characters are 0 - 127
// 128 - 255 are also ASCII characters but they are not standard ASCII character , their means they depends on operating system, terminal, The character encoding (UTF-8, Windows-1252, ISO-8859-1, etc.)
char value1{78}; // ASCII character code for 'N'
unsigned char value2{255};
std::cout << "value1 : " << value1 << std::endl;
std::cout << "value1(int) : " << static_cast<int>(value1) << std::endl;
std::cout << "value2 : " << value2 << std::endl;
std::cout << "value2(int) : " << static_cast<int>(value2) << std::endl;
return 0;
}