Help with C++ loops

Hello, I am new to C++ and have a few problems:

1) How to display a character x amount of times of which a variable is holding the amount

E.G.- Number of times user has guessed something, say 20, it is being held by "int guess", How would I go about displaying on screen a character 20 times.

2) Restart function in a loop, if a guessing game should be restarted after a player guessed the right number, what code would restart it? E.g.-

I have

do
{code}
while (player1guess =! player2guess)

so it shall keep running until player guesses right but I need a function to restart the loop afterwards.

If anyone can help me, thank you.
Put your first do-while loop inside another;
do
{code}
while(want to play again?)

As for question 1, use a for-loop.
http://www.cplusplus.com/doc/tutorial/control/#for
Also, just to note out your "NOT equal to" operator is backwards, it's suppose to be !=. ;)
Topic archived. No new replies allowed.