Hi!
I have a structure defined as follows:
Code:
struct passenger
{
int flag; //Use as a boolean - 1 if seat taken, 0 if not taken
char first[NAME];
char last[NAME];
};
typedef struct passenger pass;
And I pass it to a function to modify the contents - name and last :
Code:
void option_c(pass cust[][LABEL])
{ char ans[3], label;
int row;
printf("Enter the seat number you wish to edit: ");
seat_check(&row, &label, ans);
if (cust[row][label].flag)
printf("blah blah balh");
else
{
printf("Enter first:");
scanf("%[^\n]", cust[row][label].first);
fflush(stdin);
printf("Enter second:");
scanf("%[^\n]", cust[row][label].last);
fflush(stdin);
}
}
The problem lies in the else. For some unknown reason - the program will crash at this point