Hi Guys,

Just trying to figure out how to use dynamic memory allocation. I've got the following program:

Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QCoreApplication a(argc, argv);
  4.  
  5. char *cText;
  6. cText = new char[5];
  7. cText = "test11111";
  8.  
  9. qDebug() << cText;
  10.  
  11. delete[] cText;
  12.  
  13. return a.exec();
  14. }
To copy to clipboard, switch view to plain text mode 

Question is... why does it let me assign a string of more than 5 characters to this memory location?