This might look like a smart way to assign the return value of malloc to ptr and check if it is NULL in one step, but the malloc call and the assignment to ptr is a side effect of evaluating the expression that forms the assert condition.
This might look like a smart way. This is to assign the return value of malloc to ptr and check if it is NULL in one step. The malloc call is a side effect of evaluating the expression. The assignment to ptr is a side effect of evaluating the expression. This expression forms the assert condition.