I am a programming noob. I was working on the assignment on my own and i hit the wall right now and any help will be appreciated.
I made loop where i get input for names, rates and hours and if user type -1 it will break the loop and move on to the next loop. Everything is fine except if i type -1 for name it just doesn't break. I know the variable is string and -1 is integer and i just can't figure out what should i do to make this work.
here is part of my stupid code.
for (i = 0; i < size; i++)
{
puts("\ntype name: (type -1 to quit) \n");
scanf_s("%s", &name[i], 20);
puts("\ntype hourly rate: (type -1 to quit) \n");
scanf_s("%f", &rate[i]);
puts("\ntype hours worked: (type -1 to quit) \n");
scanf_s("%f", &hours[i]);
//if break keyword needed.
if (*name == -1 || rate[i] == -1 || hours[i] == -1)
{
break;
}