Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ascii heart in c++ windows 10 not displaying

I'm working on a poker game in c++ using Visual Studio Express 2013 on Windows 10. When i use the following code to assign suits to my cards the console displays all question marks in the place of the suits.

void printHand(Card hand[])
{

    const string SUIT = "\3\4\5\6";
    const string RANK = "23456789TJQKA";

    cout << "Your hand is: ";

    for (int i = 0; i < SIZE; i++)
    {
        cout << RANK[hand[i].ranks] << SUIT[hand[i].suits] << " ";
    }
    cout << endl;
}

When I change the suits to other characters I get the right characters like question marks, colons... When I run a for loop to show all Ascii characters, the first 32 characters display as control characters like it doesn't recognize the font.

My question is whether this is because of Visual Studio 2013 Express, Windows 10, or my machine.

like image 740
ARockwell Avatar asked Dec 11 '25 22:12

ARockwell


1 Answers

Check the checkbox in Properties that says "Use the old console" or something like that (Mine was in swedish). That solved the problem for me.

like image 97
emelie idh Avatar answered Dec 14 '25 00:12

emelie idh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!