If you want different contents at different clicks, why can't you consider (rand() % UB); Where 'UB' is the upper bound.