When I have a pointer to my template class, it only holds the right value in the function it was declared in..
[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]
Posted by Anuj on March 25, 2001 at 01:49:44:
I have declared ArrayT *authorArray; as a private data member of my database class. I initiate an object of my template class (which is ArrayT) using the declaration: ArrayT *authorArray = new ArrayT(authorsize); Now when I check the value of a private data member of the ArrayT class (using a get function), I get the expected value, in the scope of the function that I declared the statement. If I try to use that pointer, and the get function with a command like:
int x = authorArray->getelement(); , I do not get the value that I expect. Its like the value was lost, and I'm not sure why. Anyone know what could be going on?
Post a Followup