Random Numbers...Problem With FAQ Answer
Hi all,
I've just tried testing the random numbers answer in the FAQ (http://faq.cprogramming.com/cgi-bin/...&id=1043284385) and it isn't working for me. I've got the exact same C++ code shown there:
Code:
#include <iostream>
#include <ctime>
int main(void)
{
int i, r;
for (i = 0; i < 20; i++)
{
r = GetRand(10, 12);
std::cout <<"Your number is " <<r <<std::endl;
}
return(0);
}
All that happens is that line ten is highlighted, with the error "'GetRand' undeclared (first use this function)".
It's probably a real simple answer, but I've just started learning C++, so could anybody be kind enough to help?
Thanks very much,
Mike