C++ var "casting"

Discussion in 'C++' started by xan8ter, Feb 13, 2008.

Thread Status:
Not open for further replies.
  1. xan8ter

    xan8ter New Member

    Joined:
    Feb 13, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    C++ Programmer
    Location:
    Canada
    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 !


    :) :) :)
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice