Hi,
I've just written some code, but I don't have a compiler on this computer to check if it's right. Can anyone tell me if there's anything wrong? (i.e. illegal operations, etc?)
Thanks a lot.
PHP Code:
//these three lines will be in main
char original [20];
cin.getline (original,20);
char *newstring = new char [20];
newstring = encrypted (original); //particularly this line
//this is to be outsie of main.. some function for itself..
char *encrypted (char original[20]) {
char enc [20];
int c;
for (c=0; c<20; c++) {
if ( int(original[c])+1 <= 90 )
enc[c] = char(int(original[c])+1);
else
enc[c] = char(int(original[c])-25);
}
strcpy (encrypted, enc);
return (encrypted);
}