Ok, this sounds logical.
I'm accessing nothing class-specific in that method. I'm just returning a new QString Object...
{
return "Hello World!";
}
QString HelloWorld::hello()
{
return "Hello World!";
}
To copy to clipboard, switch view to plain text mode
So... i've just tested it with this:
{
_string = "Hello World!";
return _string;
}
QString HelloWorld::hello()
{
_string = "Hello World!";
return _string;
}
To copy to clipboard, switch view to plain text mode
...while _string is a member of HelloWorld class. And now it crashes, like it should!
Wondering if the compiler is optimizing the return "Hello World"; from the first hello() method out, and that is the reason no crash occures.
Or what other reason there is, why there's no error at runtime...?
Thank you!
Bookmarks