SFML community forums

Help => Network => Topic started by: iride on December 22, 2013, 05:36:03 am

Title: issues with sf::Int8
Post by: iride on December 22, 2013, 05:36:03 am
I initially thought this was a issue with networking..

int main()
{

        sf::Int8 i = 1;
        std::cout << i;
        std::cin.get();
}

This piece of code prints a smiley face to the console screen, not 1

windows 8.1 visual studio 2013
Title: Re: issues with sf::Int8
Post by: FRex on December 22, 2013, 05:46:50 am
I was about to reply to your original post that sf::Int8 is actually a char typedef so it prints as ASCII not as number.
Title: Re: issues with sf::Int8
Post by: iride on December 22, 2013, 06:26:45 am
thanks!
Title: Re: issues with sf::Int8
Post by: FRex on December 22, 2013, 06:35:17 am
So cast to int or short or something, obviously: ;)
int main()
{
    sf::Int8 i = 1;
    std::cout << static_cast<int>(i);
}