Конвертація типів даних C++
cout << (int) 3.14; // 3
int s = -30;
string b = to_string(s); // "-30"
char input[256];
cin >> input;
int value = atoi(input); // stdlib.h
string s = "-30";
int i = atoi(s.c_str()); // stdlib.h
int i = atof(s.c_str());
string s = "3.14";
double i = atof(s.c_str()); // stdlib.h лише з комою
#include <string>
stoi("99");
stof("99.99");
stod("99.999");
exit(1); // вихід з програми