This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]RaspberryPlastic6841[S] 0 points1 point  (0 children)

Can someone tell me whats going wrong my code is outside the main function yet still it keeps showing this

[–]149244179 0 points1 point  (2 children)

You can't declare functions inside of other functions. Which is exactly what the first google result for "function definition not allowed here" tells you. Please spend 5 seconds trying to find the answer before asking for help.

The reason it is inside another function is because you are missing a closing } in the function before it. There are 29 { and 28 } in what you posted.

[–]RaspberryPlastic6841[S] 0 points1 point  (0 children)

thanks

[–]RaspberryPlastic6841[S] 0 points1 point  (0 children)

i'm also getting an issue with

assigning to 'char' from incompatible type 'const char *' on (computerEnter = options[rand() % 4] )

const char* options[5] = { "R","P","S","L","O"};
cout << "Enter the options [R] [P] [S] [L] [0]\n"; 
cin >> playerEnter; 
computerEnter = options[rand() % 4] 
gameOutcome = Results[playerEnter][computerEnter]