Why is this text file turning into an executable?

Hello, I am having a strange result to my following code:


1
2
3
4
5
6
7
8
9
10
11
string text[2];
text[0] = "amz";
text[1] = "AMZ";

ofstream myfile_0("/Desktop/myfile_0");
myfile_0 << text[0];
myfile_0.close();

ofstream myfile_1("/Desktop/myfile_1");
myfile_1 << text[1];
myfile_1.close();


The strange result that I am getting is that "/Desktop/myfile_0" is a text file containing lowercase "amz" as I would expect, but "/Desktop/myfile_1", which should also be a text file containing uppercase "AMZ", is instead created as an executable file which I cannot open. Why is this happening? Thanks.
Topic archived. No new replies allowed.