-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateFormatIODemo.cpp
More file actions
38 lines (34 loc) · 1.18 KB
/
CreateFormatIODemo.cpp
File metadata and controls
38 lines (34 loc) · 1.18 KB
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
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include <clocale>
#include <Windows.h>
using namespace std;
int main()
{
// setlocale(LC_ALL, "UTF-8");
// SetConsoleCP(866);// установка кодовой страницы win-cp 1251 в поток ввода
// SetConsoleOutputCP(866);
cout << "Проверка локализации \n";
ios::fmtflags f;
f = cout.flags(); // Reading flagы status
if (f & ios::showpos)
cout << "1.Flag ios::showpos set for flow cout. \n";
else
cout << "2.Flag ios::showpos dropped for stream cout. \n";
cout << "3.Setting the showpos flag for cout stream. \n";
cout.setf(ios::showpos);
f = cout.flags();
if (f & ios::showpos)
cout << "4.Flag ios::showpos set for flow cout. \n";
else
cout << "5.Flag ios::showpos dropped for stream cout. \n";
cout << "6. Reset flag showpos for stream cout.\n";
cout.unsetf(ios::showpos);
f = cout.flags();
if (f & ios::showpos)
cout << "7.Flag ios::showpos set for flow cout. \n";
else
cout << "8.Flag ios::showpos dropped for stream cout. \n";
cout << " 9.Reset flag showpos for stream cout.\n";
system("pause");
return 0;
}