My question is this: how do I set the default value in my function of type Enum, to be one of the values in the Enum. This is my first experience with Enumerations and enumerated functions. I know a decent amount about Intro/Beginner C++.
Example.. Setting the Default value to return HANDHELD ?
Also any advice on making better/clearer questions would be appreciated.
ComputerType SellerList::ReadAndReturnComputerType() const
{
char type[MAX_NAME_LEN];
cin >> type;
if(strcmp(type, "desktop") == 0)
return DESKTOP;
else if (strcmp(type, "laptop") == 0)
return LAPTOP;
else if(strcmp(type, "tablet") == 0)
return TABLET;
else if(strcmp(type, "handheld") == 0)
return HANDHELD;
}
else return HANDHELD;?