Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Vector Returning Crap?  (Read 1084 times)

0 Members and 1 Guest are viewing this topic.
Vector Returning Crap?
« on: January 08, 2007, 04:37:34 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
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?
Logged
Re: Vector Returning Crap?
« Reply #1 on: January 09, 2007, 05:10:18 am »
  • Huzzowee!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 571
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.
Logged
"They say 'Don't sweat the little things!', but in the end, the little things are all that matter..."
--Alex2539
Re: Vector Returning Crap?
« Reply #2 on: January 09, 2007, 09:11:19 pm »
  • The Broken King
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1259
If you haven't set the char* to NULL or you haven't put anything in to it, it will give you damage.
Logged
  • Broken Kings [Temp Site]
Pages: [1]   Go Up

 


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



Page created in 0.266 seconds with 44 queries.