Switch to linux root account in executing c++ binary with password, POSSIBLE? : To All,

I am trying to copy some files to a root user from a user with very low (almost no privileges).  I need to allow someone with access to the low account copy some files onto the higher account.  I have thought about using a bin/bash script, but don't want any password in the file to be viewed.  

I decided to create a c++ application that has the password of the account I would like pass to the su/setuid commands.  I do know the password can be viewed in the binary, but is not a concern.  The password not in plain text is sufficient.  

My problem is that I cannot figure out how to "login" as the user I need to update files for a service running in that account.  I have the user account name, which is localadmin, and the password for that account.  But how do I pass these to linux to copy the files to the localadmin account home/subdirectory from the c++ application?

I have tried in c++:

**system("su localadmin");** // This prompts for password, but not sure how to pass the password.

**setuid(0);** // Again, where do I pass the password to get the account privileges?  All I get is an "operation not permitted".

I apologize if this is an easy question.  Just trying to run the commands as localadmin and be done.

Thanks for any help you can provide.