回复 4楼 吴军旗
那只能告诉你这样做不行,如果非要这样,下面是个可行的方法
#include<stdio.h>
enum color //枚举的关键字
{
red, yellow, blue, white, black
};
int main()
{
int i;
char *a[5]={"red","yellow","blue","white","black"};
for ( i = red; i <= black; i++ )
{
printf("%s\n",a[i]);
}
return 0;
}