fork download
  1. #include <iostream>
  2. void Dvachnut(char *charP)
  3. {
  4. charP = new char[5];
  5. charP[0] = '2';
  6. charP[1] = 'c';
  7. charP[2] = 'h';
  8. charP[3] = '\0';
  9. }
  10. int main()
  11. {
  12. char *p = 0;
  13. Dvachnut(p);
  14. std::cout << p[1];
  15. delete[] p;
  16.  
  17. getchar();
  18. return 0;
  19. }
Runtime error #stdin #stdout 0s 3424KB
stdin
Standard input is empty
stdout
Standard output is empty