1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Creating Dynamic Variables

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

  1. DeweyFinn

    DeweyFinn New Member

    Sep 6, 2010
    Likes Received:
    Trophy Points:
    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