2 Console windows sharing vairables

I would like to somehow have 2 console windows, with the same global varabiles. I would like it to be so that one could be "locked up" until the other "unlockes" it (by interning a password) I am making a text based game. That is why. I am also pretty new to c++
Last edited on
bump. Please, someone help me with this.
> I would like it to be so that one could be "locked up" until the other "unlockes" it
> I am also pretty new to c++

Can't you just use a file for this?

One process opens the file, writes a value into it, and then closes the file.
The other process opens the file, reads the value from it, and then closes the file.

You would be better advised to investigate framework like ncurses. Which OS are you programming on?
If you feel up to it, you could use a network socket. That way you could have the 2 windows on different computers, if you want.
Topic archived. No new replies allowed.