I'm having a ridiculously lame C++ problem..

| | Comments (0)

I've got a C++ function that returns a struct that I created. While running in the debugger, everything in the struct looks fine.

However, once I return the pointer and collect it in the other function, one of the fields in the struct is all mangled. I don't understand what the hell is going on.

Read on for more information.

(Edit: Solved.)
(Edit #2: Moved the details to a summary, it was breaking XML syndication X_x).


Here's the struct's contents BEFORE I return it:


- ti {title=0x0012dbc0 "Raspberry?Heart (VOCAL Version)" artist=0x0012dc48 "jun" album=0x0012dc00 "pop'n music 8 V-RARE SOUND TRACK 6" ...} trackInfo
+ title 0x0012dbc0 "Raspberry?Heart (VOCAL Version)" char *
+ artist 0x0012dc48 "jun" char *
+ album 0x0012dc00 "pop'n music 8 V-RARE SOUND TRACK 6" char *
+ duration 0xcccccccc char *
+ bitrate 0xcccccccc char *

Here's what it looks like *after* it's returned:


- ti 0x0012de0c {title=0x0012dbc0 "Raspberry?Heart (VOCAL Version)" artist=0x0012dc48 " Þ" album=0x0012dc00 "pop'n music 8 V-RARE SOUND TRACK 6" ...} trackInfo *
+ title 0x0012dbc0 "Raspberry?Heart (VOCAL Version)" char *
+ artist 0x0012dc48 " Þ" char *
+ album 0x0012dc00 "pop'n music 8 V-RARE SOUND TRACK 6" char *
+ duration 0xcccccccc char *
+ bitrate 0xcccccccc char *

As you can see, "artist" is totally mangled.

I don't understand why this is happening, and it's driving me up the wall. It ONLY happens on that one field, too.

I'm going to go kill myself now.

Categories

Leave a comment

Gamercard

Recent Flickr Uploads

www.flickr.com
This is a Flickr badge showing public photos from rampage. Make your own badge here.

Recently Played

Archives

Tag Cloud

Support this site!

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by Movable Type