`typedef struct student { char name[80]; int group; int marks[5]; } student; void enter(student *stu) { printf("Enter name: "); fgets(stu->name, 80, stdin); printf("Enter group: "); scanf("%d", stu->group); printf("Enter marks: "); for(int i = 0; i < 5; i++) scanf("%d", stu->marks[i]); } int main() { student arr[3]; for(int i = 0; i < 3; i++) { student * temp = &arr[i]; enter(temp); } return(0); }` Closed due to the fact that off-topic participants are Suvitruf ♦ , Sasha Chernykh , MSDN.WhiteKnight , Harry , Pavel Mayorov Jan 18 '18 at 5:38 .
It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:
- "The question is closed, as it is customary to ask questions in Russian only on Russian in Stack Overflow . Please translate your question into Russian or use Stack Overflow in English ." - Suvitruf, Sasha Chernykh, Pavel Mayorov
|
1 answer
We do not monitor compiler diagnostics? In my opinion, all modern compilers will immediately indicate these errors.
scanf("%d", &stu->group); ... scanf("%d", &stu->marks[i]); - Thanks, for not noticing blaming myself (was sleepy), here is the compiler I used - repl.it - B1ZON
- @ B1ZON: This is not a compiler, this is some kind of crap. Opportunities to see the output of the compiler there, I understand, no? - AnT
- Not always, but what do you use? - B1ZON
- @ B1ZON: If you are asking about the online compiler, then: coliru.stacked-crooked.com - AnT
|