I'm trying to assign an element from a pointer the same value as another element from the same pointer.
int testFunc() {
char *p = "123";
p[0] = p[2];
return 0;
}
Curious as to why the above code doesn't work - and what is the best way to achieve what I'm trying to do?