You have:
#define myemployee 200
scanf_s("%d", &myemployee[0].id_number);
What do you expect to happen?
The define statement is processed by the preprocessor replacing the occurrences of
myemployee
with
200
. The result is than passed to the compiler. The resulting line seen by the compiler is then:
scanf_s("%d", &200[0].id_number);
That is obviously an invalid C/C++ statement and generates a compiler error.
What you probably want to do is defining a max. number of employees and an array to store the information:
#define MAX_EMPLOYEES 200
int main()
{
employee myemployees[MAX_EMPLOYEES];
printf("employee's id number - ");
scanf_s("%d", &myemployees[0].id_number, sizeof(employee.id_number));
return 0;
}
Note that I have used all upper case for the defined constant because that is common practice and added the missing size parameter for
scanf_s
.