免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12345下一页
最近访问板块 发新帖
查看: 17238 | 回复: 45
打印 上一主题 下一主题

弱问一下,VC2008支持C++98不?2005肯定不支持了。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-20 10:13 |只看该作者 |倒序浏览

论坛徽章:
0
2 [报告]
发表于 2009-04-20 10:14 |只看该作者
VC一直都不是完全支持标准的吧。。。

论坛徽章:
2
青铜圣斗士
日期:2015-11-26 06:15:59数据库技术版块每日发帖之星
日期:2016-07-24 06:20:00
3 [报告]
发表于 2009-04-20 12:19 |只看该作者
原帖由 prolj 于 2009-4-20 10:13 发表
http://topic.csdn.net/u/20080327 ... 2-45eaae331d3c.html
这是VC2005不支持的例子


VC2005已经支持得相当好了。
没有C++编译器敢说他是完全支持标准的。

gcc目前也没做到。

我比较讨厌VS2005的是, 它公然的不支持C99 ……

论坛徽章:
0
4 [报告]
发表于 2009-04-20 12:24 |只看该作者

回复 #3 OwnWaterloo 的帖子

GCC supports the ISO C++ standard (1998) and contains experimental support for the upcoming ISO C++ standard (200x).

The original ISO C++ standard was published as the ISO standard (ISO/IEC 14882:1998) and amended by a Technical Corrigenda published in 2003 (ISO/IEC 14882:2003). These standards are referred to as C++98 and C++03, respectively. GCC implements the majority of C++98 (export is a notable exception) and most of the changes in C++03. To select this standard in GCC, use one of the options -ansi or -std=c++98; to obtain all the diagnostics required by the standard, you should also specify -pedantic (or -pedantic-errors if you want them to be errors rather than warnings).

The ISO C++ committee is working on a new ISO C++ standard, dubbed C++0x, that is intended to be published by 2009. C++0x contains several changes to the C++ language, some of which have been implemented in an experimental C++0x mode in GCC. The C++0x mode in GCC tracks the draft working paper for the C++0x standard; the latest working paper is available on the ISO C++ committee's web site at http://www.open-std.org/jtc1/sc22/wg21/. For information regarding the C++0x features available in the experimental C++0x mode, see http://gcc.gnu.org/gcc-4.3/cxx0x_status.html. To select this standard in GCC, use the option -std=c++0x; to obtain all the diagnostics required by the standard, you should also specify -pedantic (or -pedantic-errors if you want them to be errors rather than warnings).

By default, GCC provides some extensions to the C++ language; See Options Controlling C++ Dialect. Use of the -std option listed above will disable these extensions. You may also select an extended version of the C++ language explicitly with -std=gnu++98 (for C++98 with GNU extensions) or -std=gnu++0x (for C++0x with GNU extensions). The default, if no C++ language dialect options are given, is -std=gnu++98.

论坛徽章:
0
5 [报告]
发表于 2009-04-20 12:27 |只看该作者

回复 #3 OwnWaterloo 的帖子

VC2008好像也公然不支持C99

论坛徽章:
0
6 [报告]
发表于 2009-04-20 12:30 |只看该作者

回复 #3 OwnWaterloo 的帖子

嗯,必须在语句块靠前的位置定义变量。
有时候是会遇到这种问题,把扩展名改成 .cpp 就可以了

论坛徽章:
2
青铜圣斗士
日期:2015-11-26 06:15:59数据库技术版块每日发帖之星
日期:2016-07-24 06:20:00
7 [报告]
发表于 2009-04-20 12:45 |只看该作者
原帖由 prolj 于 2009-4-20 12:24 发表
GCC supports the ISO C++ standard (199 and contains experimental support for the upcoming ISO C++ standard (200x).

The original ISO C++ standard was published as the ISO standard (ISO/IEC 14 ...


大哥, 你引这么大段英文作什么………………
我英文很烂  ……  能解释下么 …………

论坛徽章:
26
处女座
日期:2016-04-18 14:00:4515-16赛季CBA联赛之深圳
日期:2020-06-02 10:10:5015-16赛季CBA联赛之广夏
日期:2019-07-23 16:59:452016科比退役纪念章
日期:2019-06-26 16:59:1315-16赛季CBA联赛之天津
日期:2019-05-28 14:25:1915-16赛季CBA联赛之青岛
日期:2019-05-16 10:14:082016科比退役纪念章
日期:2019-01-11 14:44:062016科比退役纪念章
日期:2018-07-18 16:17:4015-16赛季CBA联赛之上海
日期:2017-08-22 18:18:5515-16赛季CBA联赛之江苏
日期:2017-08-04 17:00:4715-16赛季CBA联赛之佛山
日期:2017-02-20 18:21:1315-16赛季CBA联赛之天津
日期:2016-12-12 10:44:23
8 [报告]
发表于 2009-04-20 12:49 |只看该作者
原帖由 OwnWaterloo 于 2009-4-20 12:19 发表


VC2005已经支持得相当好了。
没有C++编译器敢说他是完全支持标准的。

gcc目前也没做到。

我比较讨厌VS2005的是, 它公然的不支持C99 ……


VC有一个地方支持 C99 ,那就是 // 注释符号 ~

论坛徽章:
0
9 [报告]
发表于 2009-04-20 12:49 |只看该作者
就是说支持++98,部分支持C++2003。

论坛徽章:
2
青铜圣斗士
日期:2015-11-26 06:15:59数据库技术版块每日发帖之星
日期:2016-07-24 06:20:00
10 [报告]
发表于 2009-04-20 12:59 |只看该作者
原帖由 langue 于 2009-4-20 12:30 发表
嗯,必须在语句块靠前的位置定义变量。
有时候是会遇到这种问题,把扩展名改成 .cpp 就可以了


嗯嗯, 这个很讨厌的。
已经习惯了使用时在定义变量……   

还有 for (int i = 0 ; i< n ; ++i ) {}
在C99中 i的作用域是在for里?


其实这些都没什么 ……  写起来稍稍麻烦一点 ……
我目前最需要的是 stdint.h ……
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP