my code has 3 classes n_hexa,n_octa,n_bin. The code is here
switch(choice) { case 1: cin>>n; n_hexa nx(n); break; case 2: cin>>n; n_octa
If you want to have temporary objects inside a case, you'll need to scope them properly.
switch(choice) { case 1: { cin>>n; n_hexa nx(n); break; } case 2: { cin>>n; n_octa no(n); break; } case 3: { cin>>n; n_bin nb(n); break; } }