Program 1
Program 1
h>
#include <stdlib.h>
struct Day {
char *dayName;
int date;
char *activity;
};
int main() {
struct Day *calendar;
int size;
printf("Enter the number of days in week: ");
scanf("%d", &size);
if (calendar == NULL) {
printf("Memory allocation failed. Exiting program.\n");
return 1;
}
read(calendar, size);
display(calendar, size);
freeMemory(calendar, size);
return 0;
}