Why doesn't C++ show a narrowing conversion error when casting a float to a char?

倖福魔咒の 提交于 2019-12-04 04:57:25

I did some research and I found that -Wall doesn't warn about type conversion issues.

Instead, use the flag -Wconversion in order to get a warning about potential type conversion issues.

Remarks:

For the users of VC++, /W4 will warn you about possible loss of data during type conversions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!