Quote:
|
Originally Posted by InfoGeek
You can make your driver shorter by doing something like:
switch(mainMenuChoice)
{
case 1:
Stack<int, MaxStack>* stackClassDriver = new Stack<int, MaxStack>;
int stackItem;
break;
...
|
You can't declare something inside a switch statement and access it outside of the switch statement, it would then be out of scope.
To make the code shorter, you could move the repeated stuff into a template function.