Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 118,659 C++ Programmers for FREE! Ask your question and get quick answers from experts. There are 860 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



How write Pthread

 
Reply to this topicStart new topic

How write Pthread, Pthread

kornni
post 1 Jul, 2008 - 11:12 PM
Post #1


New D.I.C Head

*
Joined: 1 Jul, 2008
Posts: 8


My Contributions


this program write into pthread ?

CODE
#include <stdio.h>
#include <stdlib.h>
#include <time.h>


int main(int argc, char *argv[])
{
  
  int i,MAX;
  scanf("%d",&MAX);
  int number[MAX];
   /* initialize random seed: */
  srand ( time(NULL) );
  
  
  
  for (i = 0;i<MAX;i++){
      number[i]=rand();  
  }
  printf("\n\n");
  int count,min,j,k;
  for(count=0;count<MAX-1;count++)
  {
       min = count;
       for(j=count+1;j<MAX;j++){
           if(number[min]>number[j])
               min = j;
       }
       if(min!=count)
       {
           k = number[count];
           number[count]=number[min];
           number[min]=k;
       }
  }
  for(i=0;i<MAX;i++){
      printf("%d\n",number[i]);
  }
  system("PAUSE");    
  return 0;
}

User is offlineProfile CardPM

Go to the top of the page


lordms12
post 2 Jul, 2008 - 06:53 AM
Post #2


D.I.C Regular

Group Icon
Joined: 16 Feb, 2008
Posts: 300



Thanked 12 times

Dream Kudos: 225
My Contributions


And...........

What do you want?
User is offlineProfile CardPM

Go to the top of the page

captainhampton
post 2 Jul, 2008 - 08:27 AM
Post #3


D.I.C Addict

Group Icon
Joined: 17 Oct, 2007
Posts: 501



Thanked 2 times

Dream Kudos: 775
My Contributions


I'm glad you posted the code, however please let us know exactly what you need, the statement above your code is somewhat uninformative to what you want.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 10/12/08 04:02AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month