I am having problems with the proper operation of my pointers. In my main file I declare
Analysis2 analysis = Analysis2();
MaxResults maxresults = MaxResults( analysis);
Now in my MaxResults class, I want to point to the analysis so that if any of its variables change, I still get the correct value. Right now, I am declaring the constructor in the MaxResults header as
MaxResults(Analysis2 analysis);
Analysis2 * analysis2;
And in the MaxResults class
MaxResults(Analysis2 analysis)
{
analysis2 = analysis;
}
When I try to access things from an analysis that has changed, analysis2 does not seem to lag behind. How to fix this, and is there an easy way to remember pointers, links, and dereferences in the future?
source
share