For some reason, this little program I made to act as a cheat sheet for Ascii codes keeps displaying a new line and the number, '10', after the desired output. If I remove endl, it displays the 10 on the same line.
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
string choiceS;
cout << "Q to exit(windows value 81[CASE])\nNote the 10 is an irrelevant number. igrore it --\nkeys such as enter or your power"
<< " button are 1/0 values that I cannot mess with\n\nkey?\n";
Forth using getchar will create unexpected behavior if a user inputs more than one char.
getline(cin, choice);
cout<<static_cast<int>(choice[0]);
Thankyou!
So first of all I recommend reading the tutorial. That keyloop(goto method) isn't pretty, why don't you use a while loop?
I was experimenting to find out what goto does. I can use while and other such things but this is me learning more stuff.
Second, key is not declared.
I copy& pasted, leaving out some misc. stuff... and that on accident
^
Third unless you declare key as an int, cout<<key will output the key the user inputted.