已经持续通过这个代码:为什么输出结果不符合它的要求?
#include<cstdio>
#define TOTAL_ELEMENTS (sizeof(array)/sizeof(array[0]))
int array[] = {1,2,3,4,5,6,7};
int main()
{
signed int d;
printf("Total Elements in the array are => %d\n",TOTAL_ELEMENTS);
for(d=-1;d <= (TOTAL_ELEMENTS-2);d++)
printf("%d\n",array[d+1]);
return 0;
}
现在很明显,它不进入for循环。 是什么原因?
程序做了什么**? – templatetypedef 2011-03-18 19:32:23
测试你的技能。 – Sadique 2011-03-18 19:38:36
@Acme:我宁愿让我的技能在不太难看的节目中测试。 :) – GManNickG 2011-03-18 19:43:52