Desc: this is an Text Encryption and decryption program that ihave complete coding. now i need to add another function

Q1. save the encrypted msg into a file, this is because later i can display the decrypted msg along with the encrypted msg to prove that the prog can be run with input and output redirection to read and write on file.

Q2. Although this coding was completed and can be run smoothly, but there still have errors on it after compiled. the error msg is : Conversion may lose significant digits

pls help on it. Thanks

#include <iostream.h>
#include <conio.h>
#include <stdio.h>

class String
{
private:
char *string;
int len;
public:
String(char * = "");
~String(void){delete[] string;}
void getString(void){cout << "Plese enter your sentence : "; fflush(stdin); gets(string);}
void display(void){cout << "You have entered as follow : "; cout << string << endl << endl;}
int code(void);
int decode(void);
};

String::String(char *s)
{
len=strlen(s)+1;
string=new char[len];
strcpy(string,s);
}

int String::code()
{
char *temp=string;
char sample[96]={'0','1','2','3','4','5','6','7','8','9','A','B', 'C','D',
'E','F','G','H','I','J','K','L','M','N','O','P','Q ','R',
'S','T','U','V','W','X','Y','Z','a','b','c','d','e ','f',
'g','h','i','j','k','l','m','n','o','p','q','r','s ','t',
'u','v','w','x','y','z','!','"','#','$','%','&','\ \',',',
'(',')','*','+',',','-','.','/',',',':',';','<','=','>',
'?','@','[','\\',']','^','_','`','{','|','}','~'};
char code[96] ={'E','S','c','r','#','/','[','H','R','h','5','D','Q','b',
'p','"','.','^',',','0','K','W','k','x',')','1','A ','P',
'd','v','%','-',']','9','J','U','m','o','!',',','\\','4',
'G','T','i','u','&',';','{','7','C','V','f','w','$ ','_',
':','8','M','X','g','s','(','\\',',','+','|','6',' B','O',
'a','n','*','=','3','F','Y','z','q','@','`','2','N ','e',
'z',' ','~','I','l','+','?','}','L','y','<','>',};
int count=0;
for(*temp;*temp!=NULL;*temp++)
{
while(*temp!=sample[count])
count++;
cout << code[count];
count=0;
}
cout << endl;
return 0;
}


int String::decode()
{
char *temp=string;
char sample[96]={'0','1','2','3','4','5','6','7','8','9','A','B', 'C','D',
'E','F','G','H','I','J','K','L','M','N','O','P','Q ','R',
'S','T','U','V','W','X','Y','Z','a','b','c','d','e ','f',
'g','h','i','j','k','l','m','n','o','p','q','r','s ','t',
'u','v','w','x','y','z','!','"','#','$','%','&','\ \',',',
'(',')','*','+',',','-','.','/',' ',':',';','<','=','>',
'?','@','[','\\',']','^','_','`','{','|','}','~'};
char code[96] ={'E','S','c','r','#','/','[','H','R','h','5','D','Q','b',
'p','"','.','^',',','0','K','W','k','x',')','1','A ','P',
'd','v','%','-',']','9','J','U','m','o','!',',',' \\','4',
'G','T','i','u','&',';','{','7','C','V','f','w','$ ','_',
':','8','M','X','g','s','(','\\',',','+','|','6',' B','O',
'a','n','*','=','3','F','Y','z','q','@','`','2','N ','e',
'z',' ','~','I','l','+','?','}','L','y','<','>',};
int count=0;
for(*temp;*temp!=NULL;*temp++)
{
while(*temp!=code[count])
count++;
cout<< sample[count];
count=0;
}
cout << endl;
return 0;
}

void main(void)
{
char again,choice;
cout << "Welcome To Encrytion/Decryption Machine" << endl << endl;
cout << "This program is writtten by : " << endl << endl;
cout << "Name : Cha Woo Chuan" << endl;
cout << "Student ID : 020191011348" << endl << endl;
cout << "For term 1 2002 C++ assignment" << endl << endl << endl << endl << endl << endl << endl;
cout << "Please press any key to continue...........";
getche();
String sentence;
do
{
do
{
clrscr();
cout << endl << "************************" << endl;
cout << "Please choose 'E' or 'D'" << endl;
cout << "E. Encrypt" << endl << "D. Decrypt" << endl ;
cout << "************************" << endl;
cin >> choice;
}
while((choice!='E')&&(choice!='D'));
cout << endl << endl;
sentence.getString();
sentence.display();
switch(choice)
{
case 'E' : cout << "The encrypted message is : ";
sentence.code();
break;

case 'D' : cout << "The decrypted message is : ";
sentence.decode();
break;

default: cout << "Wrong input!\n";
}
cout << "You can press any key to continue or press 'q' to quit";
again = getche();
}while(again!='q');
clrscr();
cout << "Have a nice day!" << endl;
getche();
}
dd