C++, Variables reverting to initial values
<p>I have a C++ class, shapeObject, that is somewhat complicated but this question is only regarding two particular fields of the class, dX and dY.</p>

<pre><code>header:
    class shapeObject{
        public:
            shapeObject();
                    ...

        private:
            float dX, dY;
                    ... 
    };

cpp file:
    shapeObject::shapeObject(){
            ...
            dX = 0;
            dY = 0;
            ...
    }
</code></pre>

<p>These fields are only modified by one function, which adds or subtracts a small float value to dX or dY. However, the next time the value of dX or dY is read, they have reverted back to their original value of 0.0 .   </p>

<p>Since the fields are not being modified anywhere but that one function, and that function is never setting the values to 0.0, I'm not sure why they are reverting to the original value. Any ideas of why this could be happening?</p>
