#help

2 messages · Page 1 of 1 (latest)

native widget
#

Hello everyone, I have a problem with this code, why when I enter Russian characters, all sorts of characters are displayed in my console and not what I entered earlier?

#include <iostream>
using namespace std;
int main() {
srand(time(NULL));
setlocale(LC_ALL, "");
cout << "How many students do you want to enroll?" << endl;
int number = 0;
int size = 25;
cin >> number;
getchar();
char** list = new char* [number];
for (int i = 0; i < number; i++) {
list[i] = new char[size];
cout << "Enter the name of " << i + 1 << "th student" << endl;
cin.getline(list[i], size);
}
for (int i = 0; i < number; i++) {
cout << "Name" << i + 1 << "th student" << list[i] << endl;
}

}

eternal sageBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.