C ++ 0x
char* ch;
ch = new char[8]{1, 2, 3, 4, 5, 6, 7, 8};
@David Thornley: then switch these lines and there is no problem. And seriously, you are talking about redistribution char[8]in the same memory pool as the previous value, then you need to play with your own allocators, something like:
char* ch1 = new char[8]{'a', 'b', 'c', 'd', 'e', 'f', 'g', 'i'};
char* ch2 = new(ch1) char[8]{1, 2, 3, 4, 5, 6, 7, 8};
afaik OP is unlikely to be needed.
erjot source
share