Flash Gordon wrote:
>fl*****@126.com wrote:To the OP, please be aware that Flash Gordon has a history of either>I'm a student who is studying program firstly.Recently I wrote
some code below in a program.
for(i=1;i<=count;++i){
number[i]=integer % pow(10,i)/ pow(10,i-1);
}
But my compiler(VC) told me: '%' : illegal,
right operand has type 'double'.Please tell me what does it mean?
It means the right hand operand of % in your code is of type double
(because that is what pow()/pow() gives) and that is not allowed.
deliberately misleading and "miss-informing" posters to this
newsgroup or providing facile answers with which to amuse himself.
In this case, both. Facile because Flash Gordon did not tell you
substantially anything more than your compiler had told you. Misleading
and "miss-informing" in that what he did add to the compiler output
is an attempt to confuse your understanding of the precedence and
associativity rules in C. The right-hand operand to % is pow(), not
pow()/pow().
Please refer to the other posts in your thread for more informative
replies.
[snip remainder of garbage]
Yours,
Han from China