I am trying to take a user's input and assign it to a certain part of a structure. This code is in my book so I assume it's correct:
scanf("%d", &part_number);
inventory[num_parts].number = part_number;
I need to do the same thing but with a string instead of a number, but I get incompatible types in assignment error.
scanf("%s", &part_name);
inventory[num_parts].name = part_name;
How could I accomplish this?