Hi,
Im new to C++ and have so many questions..
Lets say I wanted to do a comparison of a group of datas. What are the best ways to do them in C++? For example...
I have a bunch of if statements.
if variableA is Monday,Tuesday,Wednesday cout<<"Chicken";
if variableB is Thursday,Friday,Saturday cout<<"Beef";
Is there a way to group Monday,Tuesday,Wednesday into
one variable? Thursday,Friday,Saturday into one variable and compare the two variables.Example, heres what Im thinking...
Variable1=Monday,Tuesday,Wednesday;
Variable2=Thursday,Friday,Saturday;
UserInputVariable=Tuesday;
if(UseInputVariable==variable1)
{
cout<<"Chicken";
}
if(UserInputVariable==Variable2)
{
cout<<"Beef";
}
Can we do something like what I've presented?Or are there better ways?
Im new to C++ and have so many questions..
Lets say I wanted to do a comparison of a group of datas. What are the best ways to do them in C++? For example...
I have a bunch of if statements.
if variableA is Monday,Tuesday,Wednesday cout<<"Chicken";
if variableB is Thursday,Friday,Saturday cout<<"Beef";
Is there a way to group Monday,Tuesday,Wednesday into
one variable? Thursday,Friday,Saturday into one variable and compare the two variables.Example, heres what Im thinking...
Variable1=Monday,Tuesday,Wednesday;
Variable2=Thursday,Friday,Saturday;
UserInputVariable=Tuesday;
if(UseInputVariable==variable1)
{
cout<<"Chicken";
}
if(UserInputVariable==Variable2)
{
cout<<"Beef";
}
Can we do something like what I've presented?Or are there better ways?