I have been trying to make a function that writes multiple files to a folder in the order; file1 file2 file3 ect. After some diagnostic coding I realized it was taking the string file to be equal to a smiley, heart, spade, and club, through the runs of the loop. I think its unicode, but I really don't know. How can I get my file writing function to work?
When you use file = i;, it automatically casts i to char. The ASCII code says that number 1 (for example) as a char is a smiley.
To convert it to char '1' you must add an offset to get it to ASCII numbers.
So, you can use file = (i + '0'); to solve it.
Now i is still your number but you add it an offset of the char '0'. So if i is 0 the char cast will return '0', if i is 1 the char cast will return '1' etc.