yes graciano you are correct.

I will explain the issue bit clearly.
I am developing an application in which I will run some commands using system() function, which may request password for commands with "sudo" and "ssh", in that case I need to pass the password as a string to response the command which will be waiting to get the password as input. I need help (with example code) to pass the password to the commands which are executed using the system() function.