In C and C++ parameters are passed by value, except you declare them as reference parameters, which only works in C++. Hence
void chance(int whatItem){
srand(static_cast<unsigned int="">(time(0)));
int itemChance = rand();
int Item = (itemChance % 10) +1;
int whatItem = Item;
}</unsigned>
whatItem is a value parameter that is passed into the function, but which cannot transfer a value back. On top of this fatal mistake you are re-declaring whatItem inside your function, which is not allowed.
Change your function to:
void chance (int& whatItem)
{
srand(static_cast<unsigned int="">(time(0)));
int itemChance = rand();
int Item = (itemChance % 10) +1;
whatItem = Item;
}
</unsigned>
and things will run the way you intended.