2 ms·
So what you're saying is that this is guaranteed to work: if(ptr) ptr->action1(); if(ptr) ptr->action2(); While this might blow up: if(ptr) {
by mark-r 7y ago
So what you're saying is that this is guaranteed to work:
if(ptr) ptr->action1();
if(ptr) ptr->action2();
While this might blow up:
if(ptr) {
ptr->action1();
ptr->action2();
}
That's the only if statement in all of C that works that way, and violates the principle of least surprise in a huge way.