Xcode (C++) commands into terminal

Sorry, this is a repost, but I couldn't state what I needed all that clearly so I'm going to try again, any help would be greatly appreciated!

So Xcode compiles and runs your program through the terminal (I'm on a mac), and I need this program to make shell commands (bash) in a simple way (is there a simple way?).

e.g. I'm running a program called CIAO through the terminal, which requires me to input commands in the shell to get data out, and it requires a lot of repetitive manual input to get any data. Is there a way I could make this C++ program work so that the lines of code like this one
	int p=0;
	do {
		cout<<"dmmakereg region=\"BOX("<< s - x <<","<< t - y <<","<< l <<","<< w <<","<< r <<")\" outfile=region.reg\n";
		Sleep(750);
		x = x + 0.93;
		y = y + .368;
		p++;
	} while (p<300);

is instead a shell command?
$ ./program.bin | CIAO #send the output of the program as input to CIAO
$ CIAO < input #use a text file that holds the input
¿does it help?
Why I think it might! I can't try it until later but I really appreciate your help!
Topic archived. No new replies allowed.