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.