hey super urgent

im suppose to generate a random number from 1 to 4 for the direction of a robot.

void Robot::move(int direction)
{
int direction;

direction = 0; direction<5;

srand(time(NULL));

direction = rand();

cout<< direction << endl;

}
somethings wrong..
direction = rand() % 4 + 1;
direction = rand() % 5; //?
Topic archived. No new replies allowed.