我的第二段程序updatemarking运行不了,请帮忙看一下原因
#include <stdio.h>#include <string.h>
#define N 10
void printMarks(char id[10][7],int marks[10]);
void updateMarks(char id[10][7],int marks[10]);
int main()
{
char id[10][7];// student ID consist by 6 numbers
int marks[10];
int i=0;
for(i = 0; i < N; i++)//save values for the student ID and marks
{
printf("Enter student ID and student mark: ");
scanf("%s %d",id[i],&marks[i]);
}
printf("Students Mark\n");
for(i = 0; i < N; i ++)//show all student ID and marks
{ printf("%s %d \n",id[i],marks[i]);
}
}
void updateMarks(char id[10][7],int marks[10])//update the marks
{
char nid[7];
int i,j,c;
while (c="N")// make a loop countinue ask update the score, if the answer is no, finish the programm.
{
printf("Do you want to update the score? Y/N\n");
scanf("%d",&c);
if (feof(stdin)||ferror(stdin))
break;
if (c='Y') // if the answer is yes, do the update programme
{
printf("Please enter student ID and score:");// ask new student id and new score to update the information
scanf("%s",nid);
for(i = 0; i < 10; i ++)//
{
if(strcmp(id[i], nid) == 0)//compare the student id
{
printf("Please enter student ID and score:");
scanf("%s %d",id, &marks);
/**for(i = 0; i < N; i ++)//show all student ID and marks
{ printf("%s %d \n",id[i],marks[i]);
}
break; **/
}
/** else {printf("This id is not exitsts")// if the id is wrong exist for loop
break;}**/
/**if(i == 10) printf("");
else printf("%d\n", );**/
}
}
}
printf("thanks for using our system, see you");
}