小编fmd*_*dub的帖子

40个简单的线条,1个烦人的分段故障.我真的不知道现在还要转向何处

我很抱歉,如果这是浪费时间和/或不应该在这个网站上应该是什么,但我有点想法...我仍然是编程新手,无法掌握我的老师为了指导,所以...到互联网!

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

void months( FILE* monthfp, char** monthGroup );

int main (void){
        FILE *monthfp; /*to be used for reading in months from months.txt*/
        char** monthGroup;
        int i;

        if (( monthfp = fopen ( "months.txt", "r" )) == NULL ){
            printf( "unable to open months.txt. \n" );
            exit ( 1 );
    }

    months( monthfp, monthGroup );

/*test so far*/
    for ( i = 0; i < 12; i++ ){
            printf( "%s", monthGroup[i] );
    }

    fclose( monthfp );


}
void …
Run Code Online (Sandbox Code Playgroud)

c segmentation-fault

2
推荐指数
1
解决办法
180
查看次数

标签 统计

c ×1

segmentation-fault ×1