how do i make a random generator so that my program can randomly choose from an array of operations? I know that it is not right, but I don't really know how to fully do it so I kind of made some things things up
this is part of my code in my .cpp file
Code:
{
Problem result;
char problem.m_arithmOp[4] = {'-','+','%','*'};
srand( (unsigned)time(0));
for(int i=0; i<1 ; i++)
{
result.m_arithmOp[i] = (rand()%3)+1;
}
return result;
and this is my struct in my header
Code:
struct Problem
{
int m_number1;
int m_number2;
int m_answer;
int m_level;
char m_arithmOp;
} problem;