Your struct add is a single structure but you are trying to refer to items as if it was an array. You will need to allocate space for the number of stock structures after you get the number form the user. Something like:#
struct add_stock* stocks = (struct add_stock*)malloc(sizeof(struct add_stock) * i);