I am writing one sample c++ program , but while initializing the variable inside the switch case it gives me compilation error.
if i am declaring it like int x; its not giving the error, same is happening when i am doing it inside a case block also.
#include <iostream>
using namespace std;
int main()
{
int x=3;
switch(x)
{
int y=10;
case 2:
cout<< "c++";
}
}
this gives me error like error: jump to case label [-fpermissive]
can anybody clarify my doubts