-
Learning the basics
Okay im a noob and need help im trying to make a super basic password system using 10 as the password. It works along with every other number i type in. here is the snippet:
Code:
#include <iostream>
using namespace std;
int main()
{
int a, b;
a = 10;
cin>> b;
if (b = a)
cout<<"good job";
else
cout<<"fail!";
}
ps im not using this as a password system i just want to get a feel for variables
can someone help me find the problem
-
-
b=a is assignment
b==a compares them and returns true if they're equal
-
thank you so much i didn't really understand the == until now and i didnt realize thats what i needed thanks again