Is there any way to reset the variable without assigning all the values again? ex:
int number = 5 + rand() % 5 + 1;
cout << number << endl;
cout << number << endl;
If the randomization is equal to 3, in both cout's would return 8. Would you like something like: redefine (number);
Looking like this:
int number = 5 + rand() % 5 + 1;
cout << number << endl;
redefine(number);
cout << number << endl;
So I would return 8 and another number. ps: Without having to write the whole definition of the variable again.