G
Guy Noir
Hello again. I'm assuming I'm doing something dumb here....
When I try and add a default: case to my switch statement, I get an
error that says "Error 1 Syntax error, '(' expected" and the red
squiggly is under the : after the word default. Can anyone see my silly
error? Thanks for the extra set of eyes!
-Guy
Here is the code for the entire method:
protected int[] GenerateClassfulSubnetMask(IPClasses ipClass)
{
switch (ipClass)
{
case IPClasses.ClassA:
int[] subnetMask = { 255, 0, 0, 0 };
return subnetMask;
case IPClasses.ClassB:
int[] subnetMask = { 255, 255, 0, 0 };
return subnetMask;
case IPClasses.ClassC:
int[] subnetMask = { 255, 255, 255, 0 };
return subnetMask;
case default:
break;
}
// If we reach here, something went wrong.....
int[] subnetMask = { 0, 0, 0, 0 };
return subnetMask;
}
When I try and add a default: case to my switch statement, I get an
error that says "Error 1 Syntax error, '(' expected" and the red
squiggly is under the : after the word default. Can anyone see my silly
error? Thanks for the extra set of eyes!
-Guy
Here is the code for the entire method:
protected int[] GenerateClassfulSubnetMask(IPClasses ipClass)
{
switch (ipClass)
{
case IPClasses.ClassA:
int[] subnetMask = { 255, 0, 0, 0 };
return subnetMask;
case IPClasses.ClassB:
int[] subnetMask = { 255, 255, 0, 0 };
return subnetMask;
case IPClasses.ClassC:
int[] subnetMask = { 255, 255, 255, 0 };
return subnetMask;
case default:
break;
}
// If we reach here, something went wrong.....
int[] subnetMask = { 0, 0, 0, 0 };
return subnetMask;
}