Article View: cn.comp.lang
Article #79�ҵ��죬VS��VC++��GCC��ȣ�Ч�ʺܲ�һ��
From: batch
Date: Mon, 25 Jun 2007 09:29
Date: Mon, 25 Jun 2007 09:29
17 lines
2423 bytes
2423 bytes
看看这段程序:
——————————————————————
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int a;
a = sizeof(char);
printf ("char %d\n",a);
a = sizeof(unsigned char);
printf ("unsigned char %d\n",a);
a = sizeof(short);
printf ("short %d\n",a);
a = sizeof(unsigned short);
printf ("unsigned short %d\n",a);
a = sizeof(int);
printf ("int %d\n",a);
a = sizeof(unsigned int);
printf ("unsigned int %d\n",a);
a = sizeof(long);
printf ("long %d\n",a);
a = sizeof(unsigned long);
printf ("unsigned long %d\n",a);
a = sizeof(long long);
printf ("long long %d\n",a);
a = sizeof(unsigned long long);
printf ("unsigned long long %d\n",a);
system ("pause");
return 0;
}
——————————————————————
GCC用了16.1K,VC居然用了60K,而且已经使用了优化选项!
这样相差实在离谱了点了。
Technical Details
Message-ID:
<f5o1u5$mch$1@news.yaako.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!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,68dfa6a18681adeb,start X-Google-Thread: 107c7f,68dfa6a18681adeb,start X-Google-Attributes: gid11047e,gid107c7f,public,usenet X-Google-Language: Chinese,GB Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!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: �ҵ��죬VS��VC++��GCC��ȣ�Ч�ʺܲ�һ�� Date: Mon, 25 Jun 2007 17:29:12 +0800 Organization: Bentium Ltd. (CN99) Lines: 18 Message-ID: <f5o1u5$mch$1@news.yaako.com> NNTP-Posting-Host: 61.144.79.242 Mime-Version: 1.0 Content-Type: text/plain; charset="GB18030" Content-Transfer-Encoding: base64 X-Trace: news.yaako.com 1182763782 22929 61.144.79.242 (25 Jun 2007 09:29:42 GMT) X-Complaints-To: usenet@news.yaako.com NNTP-Posting-Date: Mon, 25 Jun 2007 09:29:42 +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