打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
__STDC_LIMIT_MACROS 和 __STDC_CONSTANT_MACROS

Question:

I see this in the standard C++ libraries for my system, as well as some of the headers in a library I'm using.

What are the semantics of these two definitions? Is there a good reference for #defines like this other than

the source itself?

 

Anwser:

__STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are a workaround to allow C++ programs to use macros specified in the C99 standard that aren't in the C++ standard. The macros, such as UINT8_MAX, INT64_MIN, and INT32_C() may be defined already in C++ applications in other ways. To allow the user to decide if they want the macros defined as C99 does, many implementations require that __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS be defined before stdint.h is included.

This isn't part of the C++ standard, but it has been adopted by more than one implementation.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
CODATA Value: Planck constant
c++
关于标准C语言的预定义宏
详解C语言编程中预处理器的用法
ctime, ctime
sys/socket.h
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服