daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Dec 18th, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. #include<pthread.h>
  3. #include<stdlib.h>
  4. #include<unistd.h>
  5.  
  6. using namespace std;
  7.  
  8. void * func1(void* arg)
  9. {
  10.     printf("test");
  11.    /* int i,n= *((int* )arg);
  12.     printf("test");
  13.     for(i=0; i<10; i++)
  14.     {
  15.         printf("n = %d",n);
  16.     }*/
  17.     /*
  18.     for(i=1;i<=100;i++){
  19.         if(i%n ==0) printf("ek >> %d\n",i);
  20.         sleep(1);
  21.     }
  22.     */
  23.  
  24. }
  25.  
  26. void *func2(void* arg)
  27. {
  28.     int i, m=*((int* )arg);
  29.     for(i=0; i<10; i++)
  30.     {
  31.         printf("m = %d",m);
  32.     }
  33.     /*
  34.     if(m==0){
  35.         for(i=0;i<=100;i+2){
  36.             printf("dui >> %d\n",i);
  37.             sleep(1);
  38.         }
  39.     }
  40.     else {
  41.         for(i=1;i<=100;i+2){
  42.             printf("dui >> %d\n",i);
  43.             sleep(1);
  44.         }
  45.     }
  46.     */
  47. }
  48.  
  49. int main()
  50. {
  51.  
  52.     int x,y;
  53.     printf("inpt");
  54.     scanf("%d%d",&x,&y);
  55.     pthread_t f;
  56.     pthread_t s;
  57.  
  58.     pthread_create(&f,NULL,func1,(void*) NULL);
  59.     //pthread_create(&s,NULL,func2,(void*) &y);
  60.     while(1);
  61.     return 0;
  62. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top