Can you use if statements in a switch statement?

I'm working on a project for my class, & I'm using a switch statement. But I need to use if statements in my switch also. Is it possible?

For instance,
switch(intVariableHere)
{
case 1:cout <<"blablabla" << endl;
if (blabla)
{
cout << "blabla" << endl;
}
break;
Yes it is. (Nesting)
When in doubt, perform a test.
Last edited on
Oh ok. Thanks! I was just making sure since switch statement is another form of doing if statements, & I didn't want error messages from trying to mix the two.
Topic archived. No new replies allowed.