[Error] '' was not declared in this scope

I'm very new on the C++ language, and it will be my first programming language so please don't judge me.

Question: why it says 'Admin' and 'password' are not declared in this scope?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
#include <string>
using namespace std;

int main()
{
	int nick;
	int pass;
	nick = Admin;
	pass = password;
	cout << "Please enter in your nickname" << endl;
	cin >> nick;
	if (nick != Admin) {
		cout << "Bad nickname!" << endl;
	} else {	
    cout << "Please enter in your password" << endl;
	cin >> pass;
	}
	if (pass != password) {
		cout << "Bad password" << endl;
	} else {
	cout << "Welcome, Admin!" << endl;
	}
	return 0;
}
Lines 9,10, 13, 19 - It seems like you mean these to be literal strings of "Admin" and "password" -- if so, they need to be surrounded by the quote marks. Otherwise they appear to be variable names.

Lines 7,8 - Seems like these should be declared as string, not int.
Thank you dude! You helped me very much!
Topic archived. No new replies allowed.