Dynamic Array allocation (ANSI C)
#include<stdio.h>intmain(){inti,j,k;scanf("%d",&i);inta[i];for(j=0;j<i;j++)scanf("%d"...
#include <stdio.h>
int main()
{
int i,j,k;
scanf("%d", &i);
int a[i];
for (j = 0;j < i;j++)
scanf("%d",&a[j]);
for (k = 0;k < i;k++)
printf("%d\n", a[k]);
return 0;
}
I currently got it compiled successfully by GCC 4.0 under Mac OSX. But I just wonder can it get through using Turbo C or other compiler on Windows?
(This piece of code are depicted in ANSI C)
I mean that this piece of source code can be correctly compiled by GCC4.0
Here are my system specs and configurations:
System:Mac OSX 10.4.9
IDE: Xcode 2.4.1,
Project: Command Line Utility--S tandard Tool written it C
Could you please tell me WHY is it that it encountered errors with VC++ 6.0(WINDOWS) while it is OK when i use GCC. 展开
int main()
{
int i,j,k;
scanf("%d", &i);
int a[i];
for (j = 0;j < i;j++)
scanf("%d",&a[j]);
for (k = 0;k < i;k++)
printf("%d\n", a[k]);
return 0;
}
I currently got it compiled successfully by GCC 4.0 under Mac OSX. But I just wonder can it get through using Turbo C or other compiler on Windows?
(This piece of code are depicted in ANSI C)
I mean that this piece of source code can be correctly compiled by GCC4.0
Here are my system specs and configurations:
System:Mac OSX 10.4.9
IDE: Xcode 2.4.1,
Project: Command Line Utility--S tandard Tool written it C
Could you please tell me WHY is it that it encountered errors with VC++ 6.0(WINDOWS) while it is OK when i use GCC. 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询