void my_Func(char source_file[1024] , char dest_file[1024] , unsigned int Exp , unsigned long Mod)
{
 FILE *in, *out;
 int counter; int Ret;
 in = fopen(source_file ,"rb");
   if(in == NULL ) {
 	cout << "OOps! Source file "<<source_file<<" non-existing or corrupt file\n";
    return;
   }
   out = fopen(dest_file ,"wb");
   if( out == NULL ) {
   	fclose(in);
 	  cout << "OOps!: Failed in opening dstinaton file <" << dest_file << ">.\n";
      return;
   }
   while( (counter=fgetc(in)) != EOF ) 
   {
 //   cout<<counter << " -> ";
    Ret = Exponential_Power(counter, Exp, Mod);  
//  	cout<<Ret<<"  "; system("pause");	
	fputc( ((UCHAR)Ret) ,out);
   }
   fclose(in); fclose(out);
}
////////////////////////////////////////////////////////////////

in my function from source source each character is being read...its ascii value is read say a --> 97 , then 97 is mathematically operated...if the new number is smaller than 255 , it can be stored in the file easily ..if the new number ascii value is greater than 255 it produces problem in retrieving the same character.. how can i solve this issue..
in fact i want to store numbres in file...but when i read them they are read charater by character so i m unable to perform math operation on the code.

AHEM!

You are only reading in one character with fgetc()
Characters are a single byte. They will range from -128...0...127
since they're signed! (Or 0...255) the size of a byte, if characters are configured for 8-bit in the compiler!

There won't be a value > 255!

However you are running that character through the function
Ret = Exponential_Power(counter, Exp, Mod);

that you haven't given us! So it is unknown what range Ret will be! Please post the source for that function!

This article has been dead for over six months. Start a new discussion instead.