modulus operator objective not working? [closed]
% operator isn;t working in objective. I am doing simple seconds to minute:second conversion. the modulus operator isn't working it is giving me error "Invalid operands to binary %" what does that mean and what can I do to fix this.
thanks TC
Modulas operator only works for integers..Check whether your operands are floats..If they are floats or doubles, you can use fmodf instead..
It sounds like you're probably trying to use %
on a floating point operand, but %
only works for integer types.
精彩评论