Part 2 on encoding characters in C++ (by User123).
<- Go to the previous post.
I was yesterday making some code, and Paul Sanders in this question told me useful solution: He told me not to use std::cout << "something";
but to use std::wcout << L"something";
.
But I have another problem. Now I want to do something like this (some special characters, but in array):
#include <iostream>
using namespace std;
string myArray[2] = { "łŁšđřžőšě", "×÷¤ßł§ř~ú" };
int main()
{
cout << myArray[0] << endl << myArray[1];
return 0;
}
But now I get something really unusual:
│úܰקÜý
θĄ▀│ž°~˙
If I add L
in front of the array, I get (Visual Studio 2019):
C++ initialization with '{...}' expected for aggregate object
How can I represent these special characters but in the array?