Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #8225
| From | red floyd <no.spam.here@its.invalid> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: simple pthread |
| Date | 2011-07-25 20:55 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <j0ldrc$7kq$1@dont-email.me> (permalink) |
| References | <0655071f-8f13-4456-af6a-69b80d0a21de@glegroupsg2000goo.googlegroups.com> |
On 7/25/2011 8:45 PM, cerr wrote:
> hi There,
>
> I'm just trying to write a little sample program with a thread. I can't get my thread started and am not sure why, I get
> $ g++ -o example example.cpp
> example.cpp: In member function ‘int MyThread::StartMe()’:
> example.cpp:42:59: error: expected primary-expression before ‘void’
> example.cpp:42:63: error: initializer expression list treated as compound expression
> the code:
> int MyThread::StartMe(void)
> {
> int pthread_create(&ThreadA, NULL,&MyThread::PrintMsg, void);
get rid of "int"
> }
> //-------------------------------------------------------------
>
> void MyThread::PrintMsg(void)
> {
> cout<< "I Incremented count: "<< count<< endl;
> }
>
> Can anyone point it out? I'm like HUH???
>
> Thanks,
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
simple pthread cerr <ron.eggler@gmail.com> - 2011-07-25 20:45 -0700
Re: simple pthread red floyd <no.spam.here@its.invalid> - 2011-07-25 20:55 -0700
Re: simple pthread Ian Collins <ian-news@hotmail.com> - 2011-07-26 15:56 +1200
Re: simple pthread "Alf P. Steinbach" <alf.p.steinbach:usenet@gmail.com> - 2011-07-26 08:28 +0200
Re: simple pthread cerr <ron.eggler@gmail.com> - 2011-07-25 23:31 -0700
Re: simple pthread cerr <ron.eggler@gmail.com> - 2011-07-25 23:53 -0700
Re: simple pthread Ian Collins <ian-news@hotmail.com> - 2011-07-26 19:43 +1200
Re: simple pthread "io_x" <a@b.c.invalid> - 2011-07-26 09:57 +0200
Re: simple pthread "io_x" <a@b.c.invalid> - 2011-07-26 10:31 +0200
Re: simple pthread "io_x" <a@b.c.invalid> - 2011-07-26 12:38 +0200
Re: simple pthread Ian Collins <ian-news@hotmail.com> - 2011-07-26 22:39 +1200
Re: simple pthread Ian Collins <ian-news@hotmail.com> - 2011-07-26 22:41 +1200
csiph-web