gpt4 book ai didi

c - Visual C++ 2010/2008 在 C 模式下不接受 `__int64`

转载 作者:太空宇宙 更新时间:2023-11-04 08:05:52 24 4
gpt4 key购买 nike

我已将问题简化为以下几行:

typedef __int64 int64;
inline int64 qatoll(const char *nptr) { return _atoi64(nptr); }

使用 VC++2008 或 2010 在 C 模式下编译时出现错误:

t.c(2) : error C2054: expected '(' to follow 'inline'
t.c(2) : error C2085: 'qatoll' : not in formal parameter list
t.c(2) : error C2143: syntax error : missing ';' before '{'

在 C++ 模式下,它确实接受函数定义并且只提示 _atoi64。问题是什么,我该如何解决?Visual C++ 15 编译它没有错误,这与 C99 支持有关吗?

最佳答案

问题不在于 __int64,而在于 inline 语法,它应该是 _inline

我刚刚在一台运行 MSVC 2008 的旧机器上尝试了类似的代码来验证这一点。

关于c - Visual C++ 2010/2008 在 C 模式下不接受 `__int64`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42953693/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com