C++ var "casting"

xan8ter's Avatar, Join Date: Feb 2008
Newbie Member
I have a for loop
and I have 25 var named Case_P1 to Case_P25 in type double
I wanna do it simple as i can i just want show this var value in 25 TextBox named
ECase_1 To ECase_25:
So, i tought it was :

for (int i =1;i<=25;i++)
{

char *name= ("CaseP" + String(i)).c_str();
double *NV = reinterpret_cast<double*> (name);
E_Case_(i)->Text = String(*NV);
// I want this Case_P(i); Not supposed to be hard?!?!
//Something like that!
E_Case_(i) = Case_P(i);
}

So, i can't use vector or tabs, is an already implemented code! i can't change var types.
thx
Thx you !


0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Duplicate of C++ var "casting" by name!. Thread closed.