subscripts and surperscripts output

Hi,

Is there is a way to write superscript or subscripts into a text file. I tried using the unicode as shown in the below to get p_1 but i got a "?" please see snippet below

1
2
3
4
ofstream myfile;
myfile.open("myOutput.txt");
myfile << "p" << "\u2081" << endl; // "\u2081" for 1 as subscript
myfile.close();


thanks
A. Are you compiling in Unicode?
B. Unicode literals should have the L suffix, eg "My Unicode String Number \u2081"L
Last edited on
Well when I saved the file it asked me if i wanted to change the project to unicode, i am not sure that takes care of it automatically. Can you please elaborate a little further I am using VS2010
Topic archived. No new replies allowed.