I am trying to make a program where you are given random numbers and you need to type in those random numbers and then it will output you a message but it wond do it.
#include <iostream>
#include <string>
#include <ctime>
#include <random>
usingnamespace std;
int main()
{
int X;
string type;
for(int R = 0; R < 1; ++R)
{
X = rand() % 15;
}
cout << X << endl;
cin >> type;
if(type == X)
{
cout << "Test" << endl;
}
}
errors:
C:\Users\Chay Hawk\Desktop\Random Number writing\main.cpp||In function 'int main()':|
C:\Users\Chay Hawk\Desktop\Random Number writing\main.cpp|21|error: no match for 'operator==' in 'type == X'|
||=== Build finished: 1 errors, 0 warnings ===|