zero_shubham1

struct_function

Jul 11th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. struct student_details{
  4.     int e_num, adm_year, marks[5][5],fees_clear;
  5.     char name[100];
  6. };
  7.  
  8.  
  9. void init_student(struct student_details *pt)
  10. {
  11.     printf("Enter name of the student: ");
  12.     gets(pt->name);
  13. }
  14.  
  15. int main()
  16. {
  17.     int i;
  18.     struct student_details sd[10];
  19.     //FUNCTION CALLED FOR EACH 10 ELEMENTS
  20.     //now the error is in the line below!
  21.     for(i=0; i<10; i++)
  22.         init_student(sd[i]);
  23.     return 0;
  24. }
Add Comment
Please, Sign In to add comment