When i return 0; at the function int userselect (int user, int comp)my output displays twice and when i ask the user to run it again the computers selection of rock, paper or scissors remains the same it doesn't find a new random number. So i made the function userselect return to main(). This works and my output is displayed once, but when i run it it skips my while part of my do while loop completely so it loops the program without asking the user if they wish to run it again.
but when i return main() the computers choice re-randomizes every time so i need to find a way to get the while part of my do while to initialize and the program to not loop without the option of ending it. help!?
I got it, when you return 0, you get the output twice because you call the function twice: line 49 and line 69. I would delete line 49, and then you can use return 0 at the end of your userselect() function.
But what you should really do is declare your function void. Because your function should not return anything. Declaring the function void, you don't have any return statement in it.
It kind of work when you returned main(), because you were calling the main function inside the main function, and so everything was recursive, and you were actually not seeing the second call to userselect()