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


//typedef struct _student {
// char name[50];
// unsigned int mark;
//} student;
//
//void print_list(student list[], int size);
//void read_list(student list[], int size);
//
//int main() {
//
// const int size = 2;
// student list[size];
//
// read_list(list, size);
//
// print_list(list, size);
//}
//void read_list(student list[], int size)
//{
// printf("학생의 정보를 입력하여 주세요:\n");
//
// for (int i = 0; i < size; i++) {
//  printf("\n이름:");
//  scanf("%s", &list[i].name);
//
//  printf("\n마크:");
//  scanf("%u", &list[i].mark);
// }
//}
//void print_list(student list[], int size) {
// printf("학생들의 정보:\n");
//
// for (int i = 0; i < size; i++) {
//  printf("\n이름: %s, 마크: %u", list[i].name, list[i].mark);
// }
//}




#define LANG 50
#define MATH 25
#define ENGL 33
#define stdnt 20


typedef struct testArr {

 char arr_chr_lang[LANG],
  arr_chr_math[MATH],
  arr_chr_engl[ENGL];

} testArr;

void func_getSolution(testArr sol) {

 FILE
  *file_fp_sol;
 int
  i;

 file_fp_sol = fopen("lang_sol.txt", "r");
 fscanf(file_fp_sol, "%s", sol.arr_chr_lang);

 file_fp_sol = fopen("math_sol.txt", "r");
 fscanf(file_fp_sol, "%s", sol.arr_chr_math);

 file_fp_sol = fopen("engl_sol.txt", "r");
 fscanf(file_fp_sol, "%s", sol.arr_chr_engl);

}

int main() {

 testArr strt_testArr_sheet;

 func_getSolution(strt_testArr_sheet);

 puts(strt_testArr_sheet.arr_chr_lang);
 return 0;

}




위에 주석 처리된건 퍼온 예제인데 저건 잘만 돌아가는데

저어의 코드는 왜 구조체 초기화 디버그 에러가 뜨는지;;

구조체 뉴비 구원바랍니다요


+) 인클루드 많은건 잡탕 파일이라 그럽니다요 그냥 넘어가 주십셔