Hi , this pr. works with clases but someway it just throws me a error:

switch (atoi(i))//yes its an int 1,2,3,... etc...
		{
		case 1:
R S(r, h);//create new class R object named S,to constructor we give two     parameters
F * f1 = &S; //yess pointers polymorph....
		cout << "V = pr^2*h: " << fig1->t() << " m^3" << endl;
	        cout << "S=pr^2...: " << fig1->p() << " m^2" << endl;
		cout << endl;
		break;
		case 2://errorrr... so why & how to fix it
//error:jump to case label...
//error : crosses initialization of R

I'd be really happy if you could help me to solve this quickly :)

Hi , this pr. works with clases but someway it just throws me a error:

switch (atoi(i))//yes its an int 1,2,3,... etc...
		{
		case 1:
R S(r, h);//create new class R object named S,to constructor we give two     parameters
F * f1 = &S; //yess pointers polymorph....
		cout << "V = pr^2*h: " << fig1->t() << " m^3" << endl;
	        cout << "S=pr^2...: " << fig1->p() << " m^2" << endl;
		cout << endl;
		break;
		case 2://errorrr... so why & how to fix it
//error:jump to case label...
//error : crosses initialization of R

I'd be really happy if you could help me to solve this quickly

1. This is C++ code (such as it is). There are much better string to int conversions available than atoi

2. Use some more { }, like this

switch (atoi(i))//yes its an int 1,2,3,... etc...
		{
		case 1:
		[B]{[/B]
R S(r, h);//create new class R object named S,to constructor we give two     parameters
F * f1 = &S; //yess pointers polymorph....
		cout << "V = pr^2*h: " << fig1->t() << " m^3" << endl;
	        cout << "S=pr^2...: " << fig1->p() << " m^2" << endl;
		cout << endl;
		[B]}[/B]
		break;

Works great thx, just a mistake when I posted it on c forum I saw that i WAS C FORUM !!!
but not c++ sryyyyy

This question has already been answered. Start a new discussion instead.