I have a function in my Class which takes a char* from std input. I'm supposed to return an enum type "VehicleType". The function is part of the Vehicle class. It's supposed to return the vehicle type based on index[0] of the char*. I'm confused as how to even start this or return the element of the enum. Thanks in advance for any help.

Here's the table for the enum.

sn[0]: 0 1 2 3 4 5 6
VehicleType: badSn vehicle car truck van tanker flatbed

static VehicleType SnDecode(const char* sn)
Member Avatar for iamthwee

Start of by using a enum successfully without classes.

Then work up from there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.