I'm trying to figure out how I'm supposed to include the string into the if statement. In this, my latest, attempt the random generation works but no matter what number I input after that the result is always "Right!". How am I supposed to write the if statement so it functions properly?
#include <iostream>
#include <ctime>
#include <string>
using namespace std;
int main()
{
string p[7];
int num;
srand((unsigned)time(0));
1.) Accept user input number
2.) Does the user's number match the index of the randomly selected string array index?
3.) If yes, print "success"
4.) Otherwise, print "Wrong"