while((c=Menu())!='6')
{
switch (c)
{
case'1' : cout<<"\nentrer le nombre d'etudiant de la cycle EEA : ";
cin>>i;
etudiant EEA[i]; // etudiant is a class
break;
case'2' : break;
}
it keep giving me : " unreachable code at beginning of switch statement"
what's the problem ??
You probably need to post more of the code if you can, but my first shot is that you want something more like this:
1 2 3 4 5
c = Menu();
while(c != 6) //Leave out those single quotes
{
switch(c)
{//...Also drop the single quotes from here on as well
You cannot use switch to test for characters like this, which is what declaring those conditions with quotes does. By leaving out the single quotes you tell it to test for numbers instead.
First off it seems I was wrong in regards to my statement about the switch statement.
I'm looking into the problem now. Thanks for posting your code.
EDIT: I think Zhuge has it, except that I spotted you were trying to call the constructor you declared in line 6 in which case you need to tell the declaration to expect an integer as input and you need to change line 44 to: etudiant EEA(i); with the curvey brackets instead of the square ones.