This subroutine is very basic, however I am struggling.
When the user types q (or Q) into the input when asked for the vendor name, the program should return false... However, this function is always returning true.
MY if statement is clearly not working:
(*vendorName != 'q' || *vendorName != 'Q')
Anyone know why? Thanks.. Here's the code:
bool getVendor(data & adata)
{
char vendorName[MAX_LEN];
char phoneNum[MAX_LEN];
char productType[MAX_LEN];
int eventNum;
char events[MAX_LEN];
cout << "\nPlease enter information about the winery: " << endl;
getString("\tVendor name(type q to quit): ", vendorName);
if(*vendorName != 'q' || *vendorName != 'Q')
{
getString("\tPhone number: ", phoneNum);
getString("\tType of product: ", productType);
eventNum = getInt("\tThe amount of events: ");
getString("\tName(s) of events: ", events);
adata.setVendorName(vendorName);
adata.setPhoneNum(phoneNum);
adata.setProductType(productType);
adata.setEventNum(eventNum);
adata.setEvents(events);
return true;
}
return false;
}