zero_shubham1

code_runs_but_does_shit

Jul 11th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 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. struct student_details sd[10];
  9.  
  10. void init_student(struct student_details pt)
  11. {
  12.     printf("Enter name of the student: ");
  13.     gets((pt).name);
  14. }
  15.  
  16. int main()
  17. {
  18.     int i;
  19.  
  20.     for(i=0; i<10; i++)
  21.         init_student(sd[i]);
  22.  
  23.     for(i=0; i<10; i++)
  24.         puts((sd[i]).name);
  25.  
  26.     return 0;
  27. }
Add Comment
Please, Sign In to add comment