I have a string constant that is assigned to a variable, like this:
const char* a = "Programming";
And I want to copy it to another variable of const char*
, something like:
const char* b;
Here, I have tried memcpy()
and strcpy()
; it's not working, because in memcpy
and strcpy
, the destination variable should be char*
instead of const char*
. How do I get a copy of a const char*
?