我想删除我的帖子,谢谢

问题描述 投票:0回答:1

我想删除我的帖子,谢谢。

c++ c++11 colors sfml
1个回答
1
投票

Color
成员
r
Uint8
类型,是
unsigned char
的别名。

char
(以及
signed char
unsigned char
,以及基于这些类型的所有别名)由输出运算符<<处理为
characters

因此

cout<<Game_Text[0].getFillColor().r<<endl;

将尝试打印

r
作为 character。如果它的值不对应于可打印字符,则似乎什么都不会打印。

要打印整数值,您需要将其转换为不基于

char
的整数类型:

cout << static_cast<unsigned>(Game_Text[0].getFillColor().r) << '\n';
© www.soinside.com 2019 - 2024. All rights reserved.