I'm coming from Swift and this is my first time encountering this in Obj-C.
Normally we'd see this:
What's going on and is there a name for this particular type of if statement? Of course it's like an if else statement but what's happening when we put result = currentNumber after the braces and before the first curly bracket? Basically the if statement seems to be missing its own curly braces but the else statement has its own.
Is it just saying if currentOperation = 0 then result = currentNumber else...???
Code:
if (currentOperation == 0) result = currentNumber;
else {
Code:
if (currentOperation == 0) {
} else {
}
What's going on and is there a name for this particular type of if statement? Of course it's like an if else statement but what's happening when we put result = currentNumber after the braces and before the first curly bracket? Basically the if statement seems to be missing its own curly braces but the else statement has its own.
Is it just saying if currentOperation = 0 then result = currentNumber else...???
Last edited: