Course Solutions Uncategorized (Solved) : Explain Words Following Code Include Include Int Value Void Mythread Void Param Main Int A Q34194623 . . . .

(Solved) : Explain Words Following Code Include Include Int Value Void Mythread Void Param Main Int A Q34194623 . . . .

 

  1. Explain in your own words the following code:                                                    

#include<pthread.h>

#include <stdio.h>

int value;

void *my_thread(void*param);                                                                    

main (int argc, char *argv[])

{pthread_t tid; int retcode;

//what does thisdo

if (argc != 2) {

     fprintf(stderr, “usage: a.out <integer value>n”);

     exit(0);

}

//what does thisdo

retcode =pthread_create(&tid,NULL,my_thread,argv[1]);

//what does this do

if (retcode != 0) {

                       fprintf (stderr, “Unable to create threadn”);

                       exit (1);

           }

// What does thisdo

           pthread_join(tid,NULL);

           printf (“I am the parent: Square = %dn”, value);

} //main

// What does thisdo

void *my_thread(void *param)

  • {

           int i = atoi (param);

           printf (“I am the child, passed

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post