Creating Dynamic Variables

Discussion in 'C++' started by DeweyFinn, Sep 6, 2010.

  1. DeweyFinn

    DeweyFinn New Member

    Joined:
    Sep 6, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I wanted to know if there is such a way to declare a variable at runtime or create a dynamic variable. I've done this in Python, but I didn't know if C++ allows this. Maybe I'm not explaining it that well so I will give an example. Say I have an input file that lists the name of a variable and a associated integer:
    a 3
    b 897
    c 645
    ...So I would like to have a=3...How can this be done in C++?
     

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