Hi all
I'm a fair beginner with C++, but try bear with me. I'm having problems accessing pointers that I've stored into an array. The idea in my program is to have an array, and as the program is executed create a set of objects (which store various data). Later than in the program, I can't access that data by looping through the array that contains the pointers to these objects.
The issue rises when I try to access the data. I'll try post the relevant part of my code here:
The idea is that the pointer in *pVaraus is stored into *pList[31].Code:// my class class objVaraus { public: USHORT vrPaiva; USHORT vrPituus; string vrVaraaja; void tarkistus(); int teevaraus(); }; ==== // this is in the main() program objVaraus *pList[31] objVaraus *pVaraus = new objVaraus; objVaraus varaus; cout << "\n" << *pVaraus << "\n";
The array that stores the pointers isn't there, because I get a very long list of completely incomprehensible output when I compile it. I get the same thing with this one. I can post a part of it later, if it's necessary, though I doubt it.
Hope I'm making sense. Essentially, am I doing something fundamentally wrong with this? And how do I actually access the pointers that are in the array?
I'd appreciate all tips and ideas. Thanks.