making a command prompt

I'm trying to write a simple interpreter for a made up language, and I want to implement a command-prompt, like the one you would find in octave/matlab, R, or Prolog. I'm doing this with std::cin now, which has worked so far, but I want it to just display a new prompt whenever the user just presses enter. They way its working now whenever the user presses enter, it just jumps to the next line, and the prompt appears whenever something is actually input. I don't know if I'm explaining this very well, but does anyone have an idea on how to do this?

Prompt code:
1
2
3
4
5
while(!quit) {
	std::cout << "-> ";
	std::cin >> input;
	parse_input(&input);
}
You need to flush stdout. There should be details on the reference section of this site.
Topic archived. No new replies allowed.