Problem decrypting [Solved]
Hi all, i'm trying to do a simple crypter for strings. With the Crypt function i have no problem:
In the console i print the crypted string and it's all good. When i try to Decrypt it, the console doesn't print me anything. That's my function to Decrypt:
And finally this is how i call them in the main:
That's the result: 
I tryed to follow the debug step by step with the breakpoints but when the compiler arrives at the Decrypt function it stops and asks me for a file(ftol2.asm). I tryed to google it but all says that it's not a problem, u can easily avoid it by put the breakpoint after that instruction. So, can anyone help me? ty in advance
Code:
int lunghezza; //As globals
double valori[20];
char* AltCrypt(char* string)
{
lunghezza = strlen(string);
char* tempstring = new char[lunghezza + 1];
for (int j=0; j<lunghezza; j++)
{ valori[j] = atof(&string[j]);
tempstring[j] = string[j] + string[j+1];
j++;
}
tempstring[lunghezza/2] = 0;
return tempstring;
}
Code:
char* AltDecrypt(char* string)
{
lunghezza = strlen(string);
char* tempstring = new char[(lunghezza*2) + 1];
for (int j=0; j<lunghezza; j++)
{
tempstring[j] = valori[j];
tempstring[j+1] = string[j] - valori[j];
}
tempstring[lunghezza*2] = 0;
return tempstring;
}
Code:
cout<<"Alt-crypting: Hi man!"<<endl;
char* done = AltCrypt("Hi man!");
cout<<done;
cout<<"\n\nAlt Decrypting: "<<AltDecrypt(done);

I tryed to follow the debug step by step with the breakpoints but when the compiler arrives at the Decrypt function it stops and asks me for a file(ftol2.asm). I tryed to google it but all says that it's not a problem, u can easily avoid it by put the breakpoint after that instruction. So, can anyone help me? ty in advance


i mean, that function works, but it generate every time the same random numbers 
it works very well .-.