So my professor has given me some sample code for our project and we are suppose to basically finish the program. Anyway I came across this puzzling if statement and I can't figure out what it means. Apparrently it's checking to see
if the left side equals 0, but the left side is an assignment statement.
That's not really what's happening here, if malloc fails it returns "NULL" which would be zero. As for the rest of the code zero times anything is zero so the if statement would see zero IOW false and trigger this part of the code. Anything other then zero is seen as true in boolean operation.
EDIT: In this way we can combine an assignment and an evaluation in the same line of code, it's slightley annoying to read at first but just read some of the stuff on this forum for a while and you get used to it pretty quick.