thread creation

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

void *fork_thread(void *ptr );

main()
{
     pthread_t thread1;

     char *message1 = "Thread 1";
     int  iret1;
iret1 = pthread_create( &thread1, NULL, fork_thread, (void*) message1);

exit(0);
}
Void *fork_thread( void *ptr )
{

    int x=10;
    char *message;
    message = (char *) ptr;
     printf("%s \n", message);
       printf(" is %d",x);
}

i am a begginer ,so please don't take it as useless
please find the error in this thread creation

  1. Use [code][ / code] tags for sources and listings.
  2. C is a high-level language, so things like this should be posted in the appropriate forum
  3. Don't double-post, it's against the rules
  4. What error do you get?
  5. C is a case-sensitive language

sorry sir , i am a new user
error: expected �=', �,', �;', �asm' or �__attribute__' before �*' token
this is error is coming while i am executing

Hello Annapurna,

Your problem is the capital _V_ in void. This should be:

void *fork_thread( void *ptr ) // not Void

There are other problems with your code. May I suggest the following link? POSIX Threads | Lo�c OnStage
( In particular, the post: "The main thread" and "Pthreads arguments passing" )

Cheers,
Lo�c
--
"Computers are good at following instructions, but not at reading your mind." --