fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <cassert>
  4.  
  5. int main()
  6. {
  7. char* mem = new char[5];
  8.  
  9. char(&value)[5] = (char(&)[5])mem;
  10. value = "1234";
  11. printf("%s", value);
  12. assert(&value[0] == mem);
  13.  
  14. delete mem;
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:10:12: error: invalid array assignment
stdout
Standard output is empty