Can anyone tell me what the % sign does in the following function?
i=z%CONST;
Thanks.
Can anyone tell me what the % sign does in the following function?
i=z%CONST;
Thanks.
Well, that's not a function, but that aside...
The % sign is the modulus operator. That is to say, it gives you the remainder of dividing the left side by the right side.
x is now 1, because 7 / 3 is 2 with a remainder of 1.Code:int x = 7 % 3;
I'd suggest buying a C book.
Quzah.
Hope is the first step on the road to disappointment.
In this case it would be the modulus operator. It divides the value in z by the value in CONST, and assigns the remainder from that operation to the variable i.
~/
edit: urgh...beaten again!