1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.
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.