c++ casting char array to System::String^
ok well then can someone help me with this?
I have created a small encryption programme but, to get the information from the rich text box it gets/sets it as a System::String ^ so when i encrypt each letter inside it and try to set the String ^ back to the new encrypted values it says "System::String ^ does not have a "set" method. now i understand what this means but i do not know how to get arround this.
public: static String^ Encrypt(String^ str, char *chr)
{
printf("Encrypt -> arg[0] = %s arg[1] = %s\n",str, chr);
//i want to be able to get the plain text and encrypt it in this loop and return as a String ^
for(int i = 0; i < strlen(chr); i++)
{
//str[i] = str[i] ^ woopdewoop;
}
printf("str: %s\n",str);
return str;
}
void btnEncrypt_Click(Object^, EventArgs^)
{
String^ tmp = getEncryptionInput();
char *str = str_to_char(tmp);
printf("%s\n",Encrypt(tmp, str));
//setEncryptionOutput(str.ToString);
}
it wont let me set a string using "="
none of the lines are really screwing up… i need to be able to encrypt a System::String ^ but when i am trying to "set" the string to the new encrypted value eg. String ^str, newStr; str = "hello"; stf[i] = str[i]^143;///made up stuff
thats basicly what i want to e able to do but it wont let me set the str[i] again