Hi... just a quick one...
what would:
would this return statement return x squared or something different?Code:int somefunc(int x){
return x * x;
}
Printable View
Hi... just a quick one...
what would:
would this return statement return x squared or something different?Code:int somefunc(int x){
return x * x;
}
Yes, it would return (x * x), which is the same as x squared. At least until it overflows the integer (which happens with numbers bigger than sqrt(INT_MAX), most machines that would be sqrt((2^31)-1) -> 46340). [^ here means to the power of, rather than XOR].
--
Mats