How to send an "enter" to an existing app?

I’m developing an app that has to interact with another (for wich I don’t have the source code). I would like to know if it’s possible to send some kind of message to the existing app process to make it think that the characters (including special ones like function keys) were actually written from the keyboard.

Any help will be greatly appreciated :->

Look at popen(). Simulating function key can be tricky as you need to know that ESC sequence they use. Plus you need to make sure which terminal setting you use and make sure it always stay the same otherwise you’ll get difference ESC sequence.