Do you mean this?
#include <iostream>#include <cstring>
using namespace std;
int main() { const char* c_str = "Hello world\n"; char greetings[20]; memcpy(greetings, c_str, strlen(c_str)+1); cout << greetings << endl; return 0;}