bonjour,
je dois crypter une trame avec un ou exclusif. La trame est une CString. Voici ma fonction:
CString Ccrypto::crypter(CString trameAcrypter)
{
CString cle = "gafokehamegafr";
int i = 0;
int j = 0;
CString trameCrypte;
int nbcarcle = strlen(cle);
int nbcartrame = strlen(trameAcrypter);
for(i = 0; i < nbcartrame; i++)
{
trameCrypte[i] = trameAcrypter[i] ^ cle[j];
if(j == nbcarcle)
{
j = 0;
}
j++;
}
return trameCrypte;
}
--> Le probleme est qu'il y'à une erreur sur la ligne trameCrypte[i] = trameAcrypter[i] ^ cle[j];
L'erreur est : rror C2106: '=' : left operand must be l-value.
Je ne comprend pas, peut on m'aider?
merci