Article View: cn.comp.lang
Article #19��ά��ٿ��Ͽ���������һ�λ�����C99��C++
From: batch
Date: Sun, 29 Jul 2007 08:31
Date: Sun, 29 Jul 2007 08:31
21 lines
2840 bytes
2840 bytes
(英语版本可以直接访问,但中文不行)
在C++条目下,关于C++和C99:
Some incompatibilities have been removed by the latest (C99) C standard, which now supports C++ features such as // comments and mixed declarations and code. However, C99 introduced a number of new features that C++ does not support (such as variable-length arrays, native complex-number types, and compound literals), so the languages may be diverging more than they are converging. (However, at least some of the new C99 features will likely be included in the next version of the C++ standard, C++0x.)
非常期待,C++兼容C,可是里面也有一些C++比较难支持的项目。
正如从K&R C到ANSI C的转变,有人愿意,也有人反对。
K&R C的时候可以这样,而ANSI C89不允许:
for (int i = 0;……;……)
{
…………
}
printf ("%d", i);
C89严格很多,有人认为自由度减少了不少(自由度大是C/C++的一大特性)。C++又放宽限制。
谁知道C99的时候放宽的限制更多,宽字节支持、变长数组、long long类型、内建的复数支持(C++是通过类来支持的,不与C兼容)、指定初始化项目……
当然会有人认为这些特性是不必要的(Google搜索的时候甚至有人说它艰涩难懂,怎么又不说C90限制过多呢,要自由就要有一定的代价)。正如K%R C时代的人认为void类型没必要使用,而事实上呢?
Technical Details
Message-ID:
<f8hj8o$p89$1@news.yaako.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.news-service.com!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!news.yaako.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11047e,466bf6ecab8a2900,start X-Google-Thread: 107c7f,466bf6ecab8a2900,start X-Google-Attributes: gid11047e,gid107c7f,public,usenet X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.news-service.com!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!news.yaako.com!not-for-mail From: "batch" <chinaonhb@hotmail.com> Newsgroups: cn.comp.lang,cn.comp.lang.c,cn.fan Subject: ��ά��ٿ��Ͽ���������һ�λ�����C99��C++ Date: Sun, 29 Jul 2007 16:31:09 +0800 Organization: Bentium Ltd. (CN99) Lines: 22 Message-ID: <f8hj8o$p89$1@news.yaako.com> NNTP-Posting-Host: 61.144.105.124 Mime-Version: 1.0 Content-Type: text/plain; charset="GB18030" Content-Transfer-Encoding: base64 X-Trace: news.yaako.com 1185697880 25865 61.144.105.124 (29 Jul 2007 08:31:20 GMT) X-Complaints-To: usenet@news.yaako.com NNTP-Posting-Date: Sun, 29 Jul 2007 08:31:20 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16480