Seg Fault with malloc'd pointers

Posted by anon on Stack Overflow See other posts from Stack Overflow or by anon
Published on 2010-05-16T08:19:54Z Indexed on 2010/05/16 8:30 UTC
Read the original article Hit count: 209

Filed under:
|
|
|

I'm making a thread class to use as a wrapper for pthreads. I have a Queue class to use as a queue, but I'm having trouble with it. It seems to allocate and fill the queue struct fine, but when I try to get the data from it, it Seg. faults.

http://pastebin.com/Bquqzxt0 (the printf's are for debugging, both throw seg faults)

edit: the queue is stored in a dynamically allocated "struct queueset" array as a pointer to the data and an index for the data

© Stack Overflow or respective owner

Related posts about pointer

Related posts about c++