I've edited the question since the solution didn't work as intended for me. Is it possible to write some sort of if statement or any other code for that matter, that prints out an error message when the entered string does not exist in that struct array ? After it prints out an error message, it asks for the string again. I've tried for a while now and can't seem to get it right.
int ordet=0; char_sokafras[20];
printf("Name?\n");
scanf("%s", soka_fras);
while(ordet<*num_items)
{
if(strstr(varor[ordet].name, soka_fras))
{
printf("Name found!\n");
soka[hitta_tecken]=varor[ordet];
hitta_tecken+=1;
}
ordet+=1;
}