Answer the question
In order to leave comments, you need to log in
C++ how to change the encoding of a string?
C++. There is a need to work with specific characters of string type variables.
The variable may contain letters of the Russian alphabet. I realized that they take not one (like English) but two bytes.
For example, you need to print a letter from a string:
#include <QCoreApplication>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
string s = "Абракадабра";
cout << s[3] << endl;
return a.exec();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question