I don't understand what's wrong with this part of code of my program. I'm using a while cicle for asking the user to insert a string that will be saved to a temporary (char *name) string and then passed as argument of a function. However the problem is when I use scanf function. This is the code:
char *name;
size_t i=0;
while(i<size){
printf("Insert #%zu item name: ",i+1);
scanf("%s",name);
printf("Insert #%zu item price: ",i+1);
scanf("%u",&price);
item=item_cons(item,name,price);
i++;
}
However the problem is when I use scanf functionwhat is it?