I'm retarded (or, rather, I'm a grad student who hasn't touched C++ in fer days) and I can't remember how to do the following:
I have this threaded zorch that has a couple of shared queues, along with send and recieve threads. The send threads pick things off the queue and send them etc. My problem is that the push and pop functions to access the queue (it's standard queue.h stuff, I didn't write them) take a char* as a parameter. I want to be able to push and pop a class object. Now, if I could just cast the thing to a char* that'd work, because (and i know this is crappy tecnique, but whatever) all the systems this thingee is running on have the same OS/compiler/etc so if I sent a class/struct over as plain text, I can just cast it back and everything is peachy.
But you can't just cast a random-ass class to a char*...but i know there has got to be a way to make it plain text so I can push it to the queue etc.
Any ideas (and don't shoot me if it's something super-easy)
Thanks.
I have this threaded zorch that has a couple of shared queues, along with send and recieve threads. The send threads pick things off the queue and send them etc. My problem is that the push and pop functions to access the queue (it's standard queue.h stuff, I didn't write them) take a char* as a parameter. I want to be able to push and pop a class object. Now, if I could just cast the thing to a char* that'd work, because (and i know this is crappy tecnique, but whatever) all the systems this thingee is running on have the same OS/compiler/etc so if I sent a class/struct over as plain text, I can just cast it back and everything is peachy.
But you can't just cast a random-ass class to a char*...but i know there has got to be a way to make it plain text so I can push it to the queue etc.
Any ideas (and don't shoot me if it's something super-easy)
Thanks.