Well the program I'm writing is simple, and it's more of a hobby project, but anyways, my program is for some reason getting a smiley face and puting it in the output to a file that its writing to instead of putting the single digit number, but I can't figure out why for the life of me, can anyone tell me why it's doing this and how to fix it? By the way, I'm using put() to put the value I want into the file (or that I'm attempting to put), but instead of a "1" it puts "".
sorry it wont show the smiley that it keeps showing in the output
EDIT: Also, if wanted I could paste the source to my program on here... if it would help, I didn't post in first place cause it's a little messy cause when I debug, I tend to add very simple lines of code to tell me values of variables when something like this happens, that and the code pertaining to all this is kinda spread out throughout the source so that it does what it needs to...
#include <iostream>
int main()
{
std::cout << (char)1 << std::endl; //prints a smiley face with my environment
std::cout << '1' << std::endl; //prints a 1
return 0;
}
Some code that you think is causing the issue would be great. Remember to use [code][/code] tags.
Though it seems like you're printing a char with the ASCII value 1 as opposed to a char that is a 1.
ya, I was using an integer but when I was retrieving the value, I was using get() wrong, so it was coming back as 0 instead of 1 like I wanted, when I had a string print out what I thought It was doing it printed the one as a character, and that character happened to be a smiley, which was the exact opposite of how I felt...