SHARE
TWEET

Untitled

a guest Jul 10th, 2016 150 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. int guess_max(double x, int N, int count)
  3. {
  4.     static double my_max=-1;
  5.     if(count<N)
  6.     {
  7.         if(x>my_max)my_max=x;
  8.         return 0;
  9.     }
  10.     char* start=(char*)&x;
  11.     while(1)
  12.     {
  13.         start+=1;
  14.         double* db=(double*) start;
  15.         if(*db==my_max)break;
  16.  
  17.     }
  18.     int i=0;
  19.     for(;i<64;i++) // hmm?
  20.     {
  21.         double* db=(double*) start;
  22.         if(*db==my_max)
  23.             *db=x;
  24.         start+=4;
  25.     }
  26.     return 1;
  27. }
RAW Paste Data
Want to get better at C?
Learn to code C in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top