2 ms·
There can be: if (Foo *foo = getFoo()) { // getFoo returns null if there is no foo // There is a foo } However, this problem is basically enti
by comex 13y ago
There can be:
if (Foo *foo = getFoo()) { // getFoo returns null if there is no foo
// There is a foo
}
However, this problem is basically entirely addressed by compiler warnings, which generally ask you to add an extra set of parens for this case.