Two consoles sharing and passing data

Here is an example of what I'm trying to do...

Console 1 - cout << "please enter your name" << endl;
Console 1 - cin >> name;
Console 2 - cout << "name" << endl;
Console 1 - cout << "Now enter your age" << endl;
Console 1 - cin >> age;
Console 2 - cout << age;

and so on...

How can I do this with a visual studio cmd console program?
and why can't you do that?
Why can't I? Cause I don't know how to create two console AND I don't know how to choose which console displays which text.

I want this...

I launch my program, two separate consoles pop up.
Lets say one console shows a ascii map and the other console prompts the user to input
various information (name, direction to travel, etc). Maybe even have a third window that
displays equipped items.

The idea is that there is one main window where I tell the program what I want to do, and
then the other windows change depending on the infro.

For example...
Text Window
AsciiMap Window
Equipment Window

In the text window I could type "move north", and the AsciiMap window adjusts accordingly.
Then later, if I wanted, I could type "unequip sword", and my equipment window would change from this:

Head - Dragon Helmet
Torso - Leather Armor
Weapon - Sword

to this:

Head - Dragon Helmet
Torso - Leather Armor
Weapon - empty
I launch my program, two separate consoles pop up.

In windows, at least, a program can be associated with only one console window.
Hmm... yea I've read that before....

It just seems like with a language as versatile as c++, there should be a way to do it.

I can't imagine that if "Blizzard" wanted to do that, they couldn't. There has to be a way to create that effect.
> How can I do this with a visual studio cmd console program?

Create a second process with CreateProcess()
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx
and specify CREATE_NEW_CONSOLE as a process creation flag.

This creates a new console that is accessible to the child process (but not to the parent process).
Communicate between the two processes by placing the user input into a section of shared memory.
Topic archived. No new replies allowed.