missing file Turbo C++ ver 3

H

hpy_awad

Can any body send to me a missing file to my compiler Turbo C++ ver 3,called tv.lib
 
N

nata

Uzytkownik said:
Jacques Labuschagne <[email protected]> wrote in message
Could any body be more seriuos ?

Arnd said:
I am a c++ programmer under the os linux. I am using pthreads and i am
wondering why i can only use satic methods of a class to create a
thread of it. How can i change this, because it limits my programmes
very strongly. thanks in advance..Arnd Schröter
Vamat certificates upper mail:
The non-static member functions have different signature, that's why.
And you can't change that. You have to work your way around it. One
possible workaround is like this:


struct thread
{
static void thread_func(void* p);
virtual void run() = 0;
};

void thread::thread_func(void* p) {
// iirc pthread_create needs a function that takes a void
// pointer.
thread* t = reinterpret_cast<thread*>(p);
t->run();
}

struct some_thread : thread {
void run() {
// do your stuff..
}
};

thread* thr = new some_thread();

Now pass thread::thread_func to the thread creation function as start
routine and thr as argument to start routine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top