try
{
char *testarr = new char[15];
testarr = br.data();
delete[] testarr; //Why my application crashes here.
}
catch(...)
{
}
try
{
char *testarr = new char[15];
QString strVal1="Test";
QByteArray br = strVal1.toUtf8();
testarr = br.data();
delete[] testarr; //Why my application crashes here.
}
catch(...)
{
QMessageBox::information(0, "", "Error");
}
To copy to clipboard, switch view to plain text mode
I have two questions
1) Why my above program crashes when I call delete[] testarr; ?
2) Why the catch block doesnot hadle that exception ?
I am using Qt creator 4.8 in ubuntu OS
Bookmarks