C++ rand() keeps returning the same number
<p>I can't figure out why my program keeps generating the same random digit for every round. In fact the number won't change unless I quit and restart the program. Since I'm new to C++, this should be a fairly trivial mistake that I don't know about. Below is my code and thanks in advance for your help.</p>

<pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
#include &lt;ctime&gt;
#include &lt;cstdlib&gt;
#include &lt;string&gt;
using namespace std;

int getRandNum();

int main()
{
    int randNum = getRandNum();

    srand((unsigned int) time(NULL));

.
.
.

}

int getRandNum()
{
    int randNum;

    randNum = rand() % 3 + 1;

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