#include <iostream> #include <string.h> using namespace std; const char a[] = "12345"; int main() { char* b = new char[sizeof(a)]; strncpy(b, a, sizeof(a)); char* c = new(b) char('5'); cout << a << endl << b << endl << c; }
new
c
b
Login in to like
Login in to comment
or Read more about C++ Quizzes
Login in to like
Login in to comment