0
How a CString variable can be assigned to another CString variable
2 Respuestas
+ 4
You can use strcpy() to copy the characters, but you need to make sure the second C-string has the necessary size:
https://en.cppreference.com/w/c/string/byte/strcpy
On a sidenote, C23 might introduce strdup(), which duplicates a string while also taking care of the allocation (dynamically):
https://en.cppreference.com/w/c/string/byte/strdup