so im making a slots game for my class and having trouble with my function.
so my code starts with a random number generator then i want to take that number and put it through a function that has a else it statement that will make the number into a string.
so the question is how to input a int/number and out put a string/letter?
#include <cstdlib>
#include <iostream>
usingnamespace std;
void clearScreen();
string test1(int test);
int main(int argc, char** argv) {
string game;
int chips=100;
cout<<"Welcome to the online casino"<<endl;
cout<<"What game would you like to play We have "
<<"Game 1 and slots"<<endl;
cin>>game;
clearScreen();
srand (time(0));
if (game=="slots"){//slots start ------------------------------------------
int r1L1 = rand()%13; //R1L1=row 1 line 1
int r1L2 = rand()%13; //R1L1=row 1 line 2
int r1L3 = rand()%13; //R1L1=row 1 line 3
string test234;
r1L1=1;
test1(r1L1,test234);
cout<<r1L1;
}//slots end---------------------------------------------------------------
return 0;
}
void clearScreen(){
int i;
for(i=0;i<30;i++){
cout<<endl;
}
}
// i know this is wrong bc i have a int in a string function
string find(int inNumber,string out){
if (inNumber==1){
out=="c";
}
else{
out=="try again";
}
return out;
}