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

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 14:52:03
这个程序哪里错了?#includevoidmain(){inti;char**a={"asd","fxs","hdd","ddsg","dfe"};for(i=0;i这个程序哪里错了?#include

这个程序哪里错了?#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 怎么遍历?