Part of my program displays a list of valid IDs, their pay, and a list of bad ids. Several of the values are.. empty I guess so they display as 0s. How can I keep that from happening?

8 Years
Discussion Span
Last Post by Seriss

Much as I'd love to that isn't an option. I just need them to not show up.


Edit: Took out code because it wasn't really necessary.

And my brother in law said "It's printing 0's because you initialized them to 0, and you didn't set a value in goodEmpIds or totalPay for bad IDs. If goodEmpIds[ct] is zero then you know it's bad, and the ID would be in badEmpIds[ct] instead.".... but I can't seem to understand what he's saying :(

Edited by Seriss: n/a


Thank you so much. You helped me solve my problem. After I posted that bit there I went and looked at it some more and did what you said. Tested with if(goodEmpId > 0) in the print method and it printed perfectly.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.