|Or, the common refrain for large projects and pointers?
I am working with some licensed software, so some type/function names are abbreviated as <ObjName>.
void success( const <ObjName>& fir_)
firtemp = new <ObjName>(fir_);
firOut.open( firFile.c_str(), std::ios::binary|std::ios::out|std::ios::trunc);
firOut << *firtemp;
This is a member function of a class (it is defined inline here) which has a member variable
<ObjName> * firtemp;. firFile is a file-level const string variable.
The licensed software object <objName>> does provide an overloaded definition for the "<<" operator, and the example I'm following uses it in exactly the way I use it above to save the firtemp object to a file.
When I attempt to run this code, the
firOut << *firtemp line results in a memory access violation which is fairly consistent ... it moves around very little, as in < 16 bytes or so.
One of the things i've noticed while trying to debug this error is that when I set firtemp as a watch (I'm using VS2005), and set break points at the start of the function then step through ... the value of firtemp changes wildly. Is this expected? Also, if I insert a cout statement for the value of firtemp, it does not agree at all with the value the debugger gives ... again, I'm not sure what to expect here.
Now, in the "Autos" field in the debugger, the "this" parameter has its value in red text for most of this function call ... is this normal? If not, what does it indicate? I searched online and could find no references for this simple question.
Primary Question: Is there anything obviously wrong with what I'm doing here, or is the error having to do with the licensed code/my interface to it? Any hints for trying to find the error, if it is in my interface?