When compile, the red line is
error, invalid lvalue in assignment
How to fix this?
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 30
int main()
{
int customerCount=0;
char input[32];
char drinks[MAX][10];
char smallLarge[MAX][6];
char hotCold[MAX][5];
int i=0;
printf("How many people are at your table?: ");
fgets(input,32,stdin);
sscanf(input,"%d",&customerCount);
if(customerCount==0)
{
printf("END");
exit(0);
/*summary*/
}
printf("\n\nChoose what type of drink would you like.\n\n");
while(customerCount!=0)
{
do
{
printf("Coffee, Tea, Cocoa, or Ovaltine?: ");
fgets(input,32,stdin);
sscanf(input,"%s",drinks[i]);
}
while(strlen(drinks[i])==0);
do
{
printf("Small or Large?: ");
fgets(input,32,stdin);
sscanf(input,"%s",smallLarge);
}
while(strlen(smallLarge[i])==0);
do
{
printf("Hot or Cold?: ");
fgets(input,32,stdin);
sscanf(input,"%s",hotCold);
}
while(strlen(hotCold[i])==0);
if(strcmp(drinks[i],"None")=0)
{
printf("BILL");
exit(0);
/*print bill*/
}
}
}