submition2

This commit is contained in:
kr820js 2024-04-20 18:50:21 +02:00
parent 4e0d624004
commit 01d6ac4513

View File

@ -45,6 +45,9 @@ struct students* reading(){
struct students* current_student=first_student; struct students* current_student=first_student;
struct students* last=NULL; struct students* last=NULL;
while(fgets(buffer, sizeof(buffer), stdin )){ while(fgets(buffer, sizeof(buffer), stdin )){
if(strlen(buffer)==1){
break;
}
current_student->name=malloc(strlen(buffer) + 1); current_student->name=malloc(strlen(buffer) + 1);
strcpy(current_student->name, buffer); strcpy(current_student->name, buffer);
current_student->next_student=malloc(sizeof(struct students)); current_student->next_student=malloc(sizeof(struct students));