dumb data object holds all common values c++, is this correct
<p>So I am new to c++ and I'm writing for a scientific application.</p>

<p>Data needs to be read in from a few input text files.</p>

<p>At the moment I am storing these input variables in an object. (lets call it inputObj).</p>

<p>Is it right that I have to pass this "inputObj" around all my objects now. It seems like it has just become a complicated version of global variables. So I think I may be missing the point of OOP.</p>

<p>I have created a g++ compilable small example of my program:</p>

<pre><code>#include&lt;iostream&gt;

class InputObj{
// this is the class that gets all the data
public:
void getInputs() {
    a = 1;
    b = 2;
};
int a;
int b;
};

class ExtraSolver{
//some of the work may be done in here
public:
    void doSomething(InputObj* io) {
        eA = io-&gt;a;
        eB = io-&gt;b;
        int something2 = eA+eB;
        std::cout&lt;&lt;something2&lt;&lt;std::endl;
    };  
private:
    int eA;
    int eB;

};

class MainSolver{
// I have most things happening from here

public:
void start() {
    //get inputs;
    inputObj_ = new InputObj();
    inputObj_ -&gt; getInputs();
    myA = inputObj_-&gt;a;
    myB = inputObj_-&gt;b;

    //do some solve:
    int something = myA*myB;

    //do some extrasolve
    extraSolver_ = new ExtraSolver();
    extraSolver_ -&gt; doSomething(inputObj_);

};
private:
InputObj* inputObj_;
ExtraSolver* extraSolver_;
int myA;
int myB;


};


int main() {
MainSolver mainSolver;
mainSolver.start();
}
</code></pre>

<p>Summary of question: A lot of my objects need to use the same variables. Is my implementation the correct way of achieving this.</p>
