Search code examples
c++consolecodeblockscyrillic

How print Cyrillic text in code blocks console


I use code blocks 17.12, C++ 98 version on windows 7 Ultimate and I need to print Cyrillic text in the console.

Can you help me :)

#include<iostream>
#include <locale>    
using namespace std;
int main(){
long long r[5],turseno,brNamereni=0,ir,ic;
cout<<"Напиши 5 числа.После въдеди още едно"<<"\n"<<"Програмата ще ти 
изведе колко пъти"<<"\n"<<"се среща написанато число по-горе";
//This is bulgarian language.
for(ic=0;ic<5;ic++){
cin>>r[ic];
}

cin>>turseno;
for(ir=0;ir<5;ir++){
if(turseno==r[ir]){
brNamereni++;
}
}
cout<<brNamereni;
return 0;
}

Solution

  • Change the locale information of your program to Bulgarian by putting setlocale(LC_ALL, "Bulgarian"); at the beginning of main(). The locale settings determine how language-specific input/output operations are handled.