Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as C by Jack ( 14 years ago )
#include "my.h"
void nameSort(){
 FILE *f;
 int n=1,i,l,k=0;
 char a[51];
 char b[51];
 f=fopen("binarydata","rb+");
 while(n==1){
  n=0;
  fseek(f,0,SEEK_SET);
  while(!feof(f)){
   fread(a,1,51,f);
   fread(b,1,51,f);
   if(feof(f))
    break;
   if((strcmp((a+5),(b+5)))>0){
    fseek(f,-102,SEEK_CUR);
    fwrite(b,51,1,f);
    fwrite(a,51,1,f);
    n=1;
   }
   fseek(f,-51,SEEK_CUR);


  }
 }
 fclose(f);
 return;
}

 

Revise this Paste

Parent: 22383
Your Name: Code Language: