ok so im trying to learn switch cases so i tried to write this program to see if i understood how to write them and i wrote both my variables the same exact way and its only giving me an undeclared variable for 1 of them. here's my code, please help.
Code:
#include <iostream>
using namespace std;
int main ()
{
int a;
int b (b = 1);
int c (c = 2);
for (a = 0; a < 3; a++) {
switch (a) {
case b:
{
cout<< "wow this is really confusing\n";
}
break;
case c:
{
cout<< "now it's a little easier\n";
}
break;
default:
{
cout<< "X-P\n";
}
break;
}
}
}