ZFGC

Resources => Coding => Topic started by: Windy on January 08, 2007, 04:37:34 pm

Title: Vector Returning Crap?
Post by: Windy on January 08, 2007, 04:37:34 pm
i have a vector which i add char* to, and when i go to read it, it returns garbage, any idea why that would happen?
Title: Re: Vector Returning Crap?
Post by: Alex2539 on January 09, 2007, 05:10:18 am
Are you sure you're getting the vector and not just the memory address? It's been a while, but I do know that char* is just a pointer to a character used to allocate memory for an array of characters and simulate strings. Since it's a pointer though, it might be returning what it's pointing to, the address, as opposed to the value at that address.

But I may be wrong.
Title: Re: Vector Returning Crap?
Post by: therabidwombat on January 09, 2007, 09:11:19 pm
If you haven't set the char* to NULL or you haven't put anything in to it, it will give you damage.

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved