Why use strings at all? Because the teacher asked you to?
In this case it would be so much easier to use integers.
First define your choices
#define STONE 1
#define PAPER 2
#define SCISSORS 3
const char* compare(int, int);
int choice1;
int choice2;
cout<<"\n\n WELCOME TO STONE PAPER SCISSORS "<<endl<<endl;
cout<<" enter your choice"<<endl;
cout<<"\n 1. SCISSORS \n";
cout<<"\n 2. STONE \n";
cout<<"\n 3. PAPER \n";
cout<<"\n\nSelect a number\n\n";
cin>>choice1;
if ((choice < STONE) || (choice > SCISSORS))
Then you can decide choice2 in this fashion
choice2 = (int)ceil(compchoice * 3.0);
And the comparison function will be less cluttered as well:
const char* compare(int choice1, int choice2)
{
if (choice1 == choice2)
{
return "Try again...";
}
else
{
switch (choice1)
{
case STONE: ... ; break;
case PAPER: ... ; break;
case SCISSORS: ...; break;
}
}
}