Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main()
- {
- date *arr;
- lecturer *data;
- lecturer **courses;
- int size, i, j;
- printf("enter number of lecturers: ");
- scanf("%d", &size);
- //arr = (date*)calloc(size, sizeof(date));
- data = (lecturer*)calloc(size, sizeof(lecturer));
- courses = (lecturer**)calloc(20, sizeof(lecturer*));
- for (i = 0; i < size; i++)
- {
- printf("enter name of lectrur %d: ", i + 1);
- data[i].name = (lecturer*)calloc(20, sizeof(lecturer));
- scanf("%s", data[i].name);
- printf("enter lecturer birthdate: \n");
- scanf("%d %d %d", &data[i].birthdate.day, &data[i].birthdate.month, &data[i].birthdate.year);
- printf("enter number of courses of %s: ", data[i].name);
- scanf("%d", &data[i].num_of_courses);
- for (j = 0; j < data[i].num_of_courses; j++)
- {
- printf("enter name of course %d: ", j + 1);
- data[i].courses = (lecturer*)calloc(20, sizeof(lecturer));
- scanf("%s", data[i].courses);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement