You're right of course, if that is the restriction then he is going about it right, but the method I posted above is still useful for avoiding the floating points and finding remainders simply.
Printable View
You're very right that the rest of your post was very helpful, but I was just trying to point out that using pointers is necessary if he is trying pass (is that the correct terminology, claudiu?) for variables (or at lest their pointers) backing main.
If I understand what is being done correctly, you pass the pointers to the variables to the function and modify the values of the variables pointed to be the pointers in the function.
I think the value of pennies gets messed up through all the type conversions, and it may be a rounding issue. I got some results by adding 0.5 to the pennies and casting it as an integer.