I have a huge byte array (char array) that I am using to write to another address. e.g.
char myBytes[] = { 0x43, 0x31, 0x63 };//just an example
(char*)0x123456 = &myBytes;
but the problem is that I get an error saying
"expression must be a modifiable lvalue"
I've tried some other stuff like
char myBytes[] = { 0x43, 0x31, 0x63 };//just an example
*(char*)0x123456 = myBytes;
But I get the same error. What am i doing wrong and what can I do get what I want accomplished?
memcpy((char*)0x123456, myBytes, sizeof(myBytes));Bad idea, though...(char*)0x123456is a constant of typechar *. You cannot assign to it any more than you can assign to the value1.