寻求帮助,C语言!!!

2401_88065888 2401_88065888 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

#include <stdio.h>
#include<stdlib.h>
#include<string.h>
   char** a;
   int d[10001];
    char b[1000001];
int main()
{
 
    int m,n,j,i,c;
   
    scanf("%d%d",&n,&m);
        a=(char**)malloc(n*sizeof(char*));
    for(i=0;i<n;i++)
    {
        scanf("%d%s",&d[i],b);
        a[i]=(char*)malloc(d[i]*sizeof(char*));
        for(j=0;j<d[i];j++)
            a[i][j]=b[j];
    }
      
    for(i=0;i<m;i++)
    {
        scanf("%d",&c);
        c--;
        for(j=0;j<d[c];j++){
            printf("%c",a[c][j]);}
        printf("\n");
    }
    for ( i = 0; i < n; i++) {
        free(a[i]);
    }
    free(a);
    system("pause");
    return 0;
}为什么   char** a;
   int d[10001];
    char b[1000001];这个要设置全局变量放在int main中就出现“System.StackOverflowException”类型的未经处理的异常出现在 未知模块 中,求帮助

...全文
评论
收藏 已收藏
分享
返回顶部