How does return work here?

前端 未结 5 640
野性不改
野性不改 2021-01-27 06:25

new question: but why the expression from n == number, from firstFactorPtr == factor1 ?

Can somebody explain me, how this works:

return ( factor ==

5条回答
  •  粉色の甜心
    2021-01-27 06:48

    return (factor == 1) means 'return true if factor == 1, return false if factor != 1'. The function called Factor() returns true if the value of the 'factor' variable went all the way down to 1 (meaning that it couldn't find any factors for the 'number' variable). The function returns false if 'factor' did not make it all the way down to 1, meaning that it was able to find at least one factor for 'number'.

提交回复
热议问题