我是 C 编程的新手,目前正在大学上课。我遇到了这个错误,并且不确定如何在谷歌数小时后修复它。我正在创建一个打印成绩报告并不断遇到此错误的程序。
这是代码:
#include <stdio.h>
#include <stdlib.h>
int main (void)
{ char Name[20];
char cid1[5]="", cid2[5]="", cid3[5]="", cid4[5]="", cid5[5]="", cid6[5]="";
char Description1[20]="", Description2[20]="", Description3[20]="", Description4[20]="", Description5[20]="", Description6[20]="";
int hrs1 = 0, hrs2=0, hrs3=0, hrs4=0, hrs5=0, hrs6=0;
char grade1[1]="",grade2[1]="",grade3[1]="",grade4[1]="",grade5[1]="",grade6[1]="";
printf("Enter Students Name ");
gets(Name);
printf("Enter Class ID ");
scanf("%s", &cid1);
printf("Enter Class Description ");
gets(Description1);
printf("%s", Name);
printf("%s", cid1);
printf("%s", Description1);
system("pause");
}