Suppose you have the following declarations:
struct person {
int start_year;
char name[15];
char *occupation;
}
struct person *new_employee;
struct person employee1;
char first_name[10];
char last_name[10];
struct person employee_array[5];
void person_lookup(struct person *e);
Consider each of the following statements or group of statements
in isolation from the
others. Place a checkmark next to any statement that would cause
a compiler error and explain why it would cause a compiler error.
Place an "X" next to any statement that could cause a runtime
execution error and explain what type of error it might cause.
Do not assume that any malloc statements have been executed before
these statements are executed.
- employee1->start_year = 1960;
- person_lookup(&employee_array[3]);
- scanf("%d %s %s", employee1.age, employee1.name, employee1.occupation);
- person_lookup(employee1);
- strcpy(employee1.name, first_name); strcat(employee1.name, last_name);
- strcpy(employee1.occupation, first_name);
- new_employee = malloc(struct person);
- employee_array[2].start_year = 2003;