I am trying to create a text RPG with an ability check system similar to dungeons and dragons. I wanted to make a function that I could call any time I wanted to make an ability check, but I came accross the error:
expression must be a modifiable Ivalue, but I need the variable to be used to substitute for other variables in the parameter.
1 2 3 4 5
int abilityCheck(int x) {
//x = the ability
x +(rand() % 30 + 1) = ability_check_result;
return ability_check_result;
}