I think, you need to make your compute_coins a bit generic. Also, a bit of change in signature is required. What type of coins it will return. lets take an enum
quarter = 1,
dime = 2,
penny = 3
typeofcoin computeCoin(int coinValue, int& number, int& amountLeft);
Multiple calls to computeCoin will be required. Lets say for 86;
computeCoin(86, pm1, pm2);
pm1 will have 3, pm2 will have 11 and return type will be quarter;
computeCoin(11, pm1, pm2);
pm1 will have 1, pm2 will have 1 and return type will be dime.
computeCoin(1, pm1, pm2);
pm1 will have 1, pm2 will have 0 and return type will be dime.
as soon you see pm2 is 0, which means all the change is returned, you will stop.
in the main, you can do something like this:
while(pm2 != 0)
computeCoin(86, pm1, pm2)
make sense ? Could you try to write computeCoin now ?