if (data[4] = 0){
remember, = means to assign. So that is saying assign 0 to data[4] and then, if the result of that is true, execute the iff.
the operator == means check if they're equal. You will almost always want to use this one inside of if statements.
think about it this way: if you see "=", think "assign", if you see "==" think, "are they the same?"