What you can do is system((passtosystem + " " + word).c_str(), but I don't think that's really what you want. That will just cause an infinite loop of A running B running a new instance of A running a new instance of B running a new instance of A...
What you probably want is inter-process communication (IPC). There are a number of varieties of this, but the "pipe" sounds like what you want. Other IPCs are semaphores, mutexes, shared memory, message queues, or even using files in the file system.
Flavors of IPCs and the system calls to use them are OS dependent, so one size does not necessarily fit all.
I don't program IPC code very often. If you are using Linux, here is a nice chapter discussing it (it's amazing what google will find for you). Section 5.4 discusses pipe. The flavor of pipe you probably want is a fifo, as described in 5.4.5.
For examples of code, somebody else will have to help out.
IPC is not rocket science, but it is not trivial, either. If I recall correctly (it's been a number of years), my Operating Systems course in college spent a few weeks covering the subtleties of IPC. I also wrote my Thesis about generating code to handle IPC while avoiding various problems. Unfortunately, I was generating Ada code, and I don't remember the coding details, just the high level concepts.
Various models of IPC challenges have been developed, from the simple Producer / Consumer model (your problem is a variation of this), to the Dining Philosophers model (the deadlock problem) to problems of starvation. So, while cutting and pasting some simple FIFO code from somebody on the forum (sorry, I don't have any available for you) might get you past the immediate problem at hand, there is a bigger realm of IPC that it would behoove you to learn about. You should at least learn the terminology and what the problems are so you are aware of what you are getting into in the future.