This is week number 5 of my programming education. I have read the rules of the forum. I do not want anyone to do my homework for me. I have spent two days on this and I am getting no where. I am writing a function that will take in a license plate number and desired lot position (eg 123vhs 5). I am to search the (already nulled array) for cars in that position, if no car is there, print 'your cars is parked in lot 5'. If a car is there, put the car in the next empty lot. If lot is full, print 'lot is full'
it is probably obvious that this won't work, I need a few pointers in the right direction.
void Addcar (char cars[PLATE][MAX])//function to add a car
{ int number=0;
number++;
if (number > MAX)
{
puts("Lot is full!");
return;
}
{
int i,j,k;
for(i=0; i<=PLATE; i++)
{ for (j=0;j<=MAX;j++)
scanf("%s%s%s",&i,&j,&k);
sprintf(cars,"%s,%s",i,j);
printf("Car parked in space %s!\n",cars);
}
}
}