Hello,
in my C class I'm one step away from completing my program with all of the required output and details. The one thing I'm stumped on is data validation.
Basically, I read from an input file in a specific format. The first value is a char that can either be, C, c, T, t, B, b. They stand for car, truck, and bus and are put into a switch.
I do fscanf to read from the file, but if someone uses a data file with say, a first value that is like X, or V, or straight up "feces", I want the program to terminate.
Problem is, I can't simply do
if (*vehicle != 'c' || 'C' || ...) because boolean operators, I assume(that's what visual studio says), are inoperable with chars.
I can post my code if it is necessary.
Thank you.