I have a problem with writing unicode to a file in C++. I want to write to a file with my own extension a few smiley faces that you can get by typing ALT+NUMPAD(2). I can display it on CMD by making a char and assigning the value of '\2' to it and it will display a smiley face, but it won't write it to a file.
Here is a snippet of code for my program:
ofstream myfile; myfile.open("C:\Users\My Username\test.exampleCodeFile"); myfile << "\2"; myfile.close();
It will write to the file, but it wont display what I want. I would show you what it displays but StackOverflow won't let me display the character. Thanks in advance.