cout char is a number
Hi all, I'm trying to print off a grid system in c++.
My problem is that whenever i try to add to the ascii number it prints off as a number instead of the letter/symbol
Here is a snippit of my code
As you can see I'm tried casting, doesn't work.
char start = 'a'
cout << (char)start+1;
In addition the start++ doesn't work.
Thank you in advanced.
Try (char)(start + 1). Actually, it would be easier to just print start and let the start++ do its work for the next iteration.
Wait, there is no loop. So perhaps you should increment start before printing; I don't know what exactly you want to do.
Ah thank you. I figured why start++ wasn't working.
I needed to make start a static char.
Thank you anyway.