You might try calling srand(). It's supposed to work over more compilers than randomise and only needs calling once.
This is nicely explained in our FAQs, so you would do well to have a look. FAQs
This should be more what you are looking for;
Code:
#include <iostream>
using namespace std;
#include <cstdlib>
#include <ctime>
int throwdice(void);
int main(int argc, char *argv[])
{
int times;
srand(time(NULL));
cout<<"how many times?" <<endl;
cin>>times;
for (int i=0; i<times; i++)
{
int result=throwdice();
cout << "Dice roll " << i+1 << " = " << result << endl;
}
return 0;
}
int throwdice(void)
{
int result;
result=(rand()%6)+1;
return result;
}