C++ Guess Number game crashing on other computers and infinite loop fix
<pre><code>// Guess my number
// My first text based game
// Created by USDlades
// http://www.USDgamedev.zxq.net

#include &lt;cstdlib&gt;
#include &lt;ctime&gt;
#include &lt;string&gt;
#include &lt;iostream&gt;

using namespace std;


int main()
{

    srand(static_cast&lt;unsigned int&gt;(time(0))); // seed the random number generator

    int guess;
    int secret = rand() % 100 + 1; // Generates a Random number between 1 and 100
    int tries =0;

    cout &lt;&lt; "I am thinking of a number between 1 and 100, Can you figure it out?\n";

    do 
    {
        cout &lt;&lt; "Enter a number between 1 and 100: ";
        cin &gt;&gt; guess;
        cout &lt;&lt; endl;
        tries++;

        if (guess &gt; secret) 
        {
            cout &lt;&lt; "Too High!\n\n ";
        }
        else if (guess &lt; secret)
        {
            cout &lt;&lt; "Too Low!\n\n ";
        }
        else
        {
            cout &lt;&lt; "Congrats! you figured out the magic number in " &lt;&lt; 
                    tries &lt;&lt; " tries!\n";
        }
    } while (guess != secret);

    cin.ignore();
    cin.get();

    return 0;
}
</code></pre>

<p>My code runs fine on my computer but when a friend of mine tries to run it, The program crashes. Does this have to do with my coding? Also I found that when I enter a letter for a guess, my game goes into an infinite loop. How can I go about fixing this issue? </p>
