E
easy
The following code gives me compiler errors galore telling me that I'm
crossing the initalization of the vectors and that case label 2 and
default are "within scope of cleanup or variable array". I suspect its
the destructors for the vectors that is causing the problem but why are
they being called at all? Shouldn't they go out of scope at the
closing bracket after default?
Putting brackets around the contents of case1 solves my problem but I
still dont understand why I need to do so.
void Test1(int value)
{
switch(value)
{
case 1:
std::cout << "Testing Scanner DAC" << std::endl;
std::vector<uint32_t> test;
std::vector<uint32_t> result;
break;
case 2:
break;
default:
break;
}
}
Thank you for your time.
crossing the initalization of the vectors and that case label 2 and
default are "within scope of cleanup or variable array". I suspect its
the destructors for the vectors that is causing the problem but why are
they being called at all? Shouldn't they go out of scope at the
closing bracket after default?
Putting brackets around the contents of case1 solves my problem but I
still dont understand why I need to do so.
void Test1(int value)
{
switch(value)
{
case 1:
std::cout << "Testing Scanner DAC" << std::endl;
std::vector<uint32_t> test;
std::vector<uint32_t> result;
break;
case 2:
break;
default:
break;
}
}
Thank you for your time.