这个程序哪里错了?#includevoid main(){ int i; char**a={"asd","fxs","hdd","ddsg","dfe"}; for(i=0;i

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/14 21:18:46

这个程序哪里错了?#includevoid main(){ int i; char**a={"asd","fxs","hdd","ddsg","dfe"}; for(i=0;i
这个程序哪里错了?
#includevoid main(){ int i; char**a={"asd","fxs","hdd","ddsg","dfe"}; for(i=0;i

这个程序哪里错了?#includevoid main(){ int i; char**a={"asd","fxs","hdd","ddsg","dfe"}; for(i=0;i
#include<stdio.h>

int main()
{
    int i;
    char *a[] = {"asd","fxs","hdd","ddsg","dfe"};
    for(i=0;i<5;i++) {
        printf("%s\n",a[i]);
    }
    return 0;
}
声明 **a 不能作为数组赋值初始化,要用 *a[].
for 循环遍历要给 a 提供下标.你全部循环里都用固定的 a 怎么遍历?