it's been a while since I've reversed strings in the file the following code should work
Code:
// CH reads char from the file
// i is the offset of the file u r reading from ( end of the file)
// size is the offset i multiplied by -1
// *f2 is the file pointer we save the reversed string
// *f1 is the file pointer we read the string from
int Recursion( char CH , long i ,long SiZe, FILE *f2 , FILE *f1)
{
fputc(CH , f2); // Puts it in a new file
// printf("%c" , CH);
if ( i == SiZe )
return 0;
i--;
fseek(f1 , i , SEEK_END) ;
CH = fgetc(f1);
printf("%c" , CH);
Recursion( CH , i , SiZe ,f2 , f1);
}
// I'm not sure if the if statement is right c if it works it may print some spaces :P //
Hope this makes things clearer for ya