I have the following example of code:
#include <iostream>
int main() {
char test[] = "êêê"; // test[10] won't compile. Use test[13] or just test[]
std::cout << "The string " << test << " consists of " << sizeof test << " bytes: ";
for (std::size_t n = 0; n < sizeof test; ++n)
std::cout << std::hex << +(unsigned char)test[n] << ' ';
std::cout << '\n';
}
which on a c++ online shell like cpp.sh gives me the following result:
The string êêê consists of 7 bytes: c3 aa c3 aa c3 aa 0
and when I try it on VS2013 it gives me the result:
The string êêê consists of 7 bytes: a8 ba a8 ba a8 ba 0
Could someone explain to me why this is, and how to fix it? I've tried to change the character set, but it still gave the same thing.