View Full Version : C++ accesing terminal

January 1st, 2007, 07:33 PM
I'm writing a C++ program to add lyrics to a song using eyeD3. This is what I have so far:

#include <iostream>
#include <string>

using namespace std;

int main ()


string dir;
string lyr;

cout<< "music file directory: " ;
cin >> dir;
cout<< "lyrics: " ;
cin >> lyr;
What I wanted to know is how to I tell the program to run a command to the terminal, say xterm? Any help would be appreciated.

January 1st, 2007, 08:09 PM

January 1st, 2007, 10:21 PM
Great! that opens up the xterm, thanks a lot! But how do I ad text to appear in the terminal?

Becasue i want to run the command, so I oppened the xterm but how can I add text in the oppened xterm?

January 1st, 2007, 11:18 PM
I just realised I could:


But how could I add strings to that?

January 1st, 2007, 11:26 PM
I dont get the question...

Doing something like...


is the same as entering it into the terminal manually.

In c++...

cout << "ls"

Will print the letters "ls" to the terminal the same way "echo" does.

So you can send commands to the terminal and print text to it, what else are you wanting to do?