The simplest solution would be to scatter the password in memory. Do not store it as a string. Declare a set of byte variables and scatter the password among them. This does not make the password irrevocable, but it makes it difficult ... an attacker needs access to both the computer and your source (or to reconstruct your binary file) to find out how and where the password bits are stored.
If an attacker has access to your system and your source or to the ability to modify your binary, you will be as good as sending him passwords.
A more likely angle of attack in your scenario would be to capture the password during the transfer of the service, rather than trying to collect it from memory.
EDIT: If you want to significantly increase the complexity of password collection, you can also use dynamic memory allocation to prevent bits from a fixed location in memory. But to be honest, this is outwitting ... it would be just as easy for an attacker to catch a password when you pass it to the service.
source share