Hi - I'm completely new to C and trying to read some code that doesn't make sense to me. For proprietary reasons I can't display the code here but I'll describe it...and list part of it in a generic form below. I know the basics about IF conditions and have read plenty of them without difficulty but this one is really confusing me.
There is a long, complicated IF condition (1 AND and 2 ORS, with 2 parts to each OR and 2 NOTs!), then a list of code to execute if the IF condition is true, under it.
The execution code looks like this:
output = variable x
variable y = output
variable z [0] = output
variable z [1] = variable [0]
I am very confused. This is part of a continuous simulation block and variables x and y are different inputs to the block, which cannot possibly be the same and (when I tested it) are not forced to be equal to the same value, yet both are said to be equal to the output, which can be only one value. The block runs without glitches so I don't think it's an error in the code. Could someone please explain to me how to read this code? It doesn't make any sense to me but it must be just something I don't know about IF conditions or ignorance of some sort. I'm wondering if the first line is executed during the first time step in the simulation, then the next line during the next time step,or something...
Also, the last 2 lines above...what does this mean? I know about arrays and assume that this has to do with values at different time steps...value 0 is defined at one step, then value 1 is defined at the next step, etc. but I don't get what this code is saying.
Any help would be much appreciated. Thank you so much!