ZFGC
Resources => Coding => Topic started 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?
-
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.
-
If you haven't set the char* to NULL or you haven't put anything in to it, it will give you damage.