hoffnung hoffnung - 4 months ago 30
C++ Question

round down function using floor(c++)

I want to make a simple function that rounds down a double into integer with one condition. If it rounds down to zero, I want it to return 1.

This is what I made.

int Round(double number)
int result;
return result;

But somehow it always returns 0... Any idea whats wrong with my code?

Its done with c++ in visual studio 2010.


= is used for assignment. Use == for comparison: