Is there a reason you aren't using bash, or perl, or anything simpler? C/C++ really isn't streamlined for these tasks.
Particularly I have been using JavaScript, Ruby, Sass, ect for so long I wanted to come back to where I learned to program and brush up on some c++. I find it hard to program something pointlessly so I put my efforts towards automating some of my commonly done tasks. I could have just as easily accomplished this using the node v8 engine as well. I just wanted to remember what c++ was like xD.

system() isn't really how you want to handle this.
Correct I did read about some of the inherent issues with system. In this case it would be if someone were to replace what the task `npm` was with some other potentially malicious program then I would be granting open access.

None the less for the sake of learning is there a known way to accomplish automating user input using something from the fork/exec family of commands?