I'm new to computer science and while writing this code I keep having the same error message at line 102-106 where it says function definition is not allowed here.
but after doing that I get a problem in line 58 where it states:
"warning: control reaches end of non-void function [-Wreturn-type]
}"
and the code wont run
BTW, another fix you should make, after fixing getUserChoice().
Do NOT call srand() in getComputerChoice(). That resets the random number generator every time you call the function. Remove that line and move it up near the top of your main function, so it gets called only one time at the start of your program.
Personally I would avoid using the C library -- <cstdlib & <ctime> -- for generating random numbers, I'd use C++ <random> and <chrono>.