If you don't understand the error message, ¿why did you remove information from it? (as it is, we can't know which objects is referring to, or what line is it happening)
I realize that the message is quite lengthy, so send it to a file and upload that.
You may want to take a look at those lines that say `error'
g++ foo.cpp 2>&1 | grep error
foo.cpp:14:9: error: ‘usuario’ was not declared in this scope
foo.cpp:19:6: error: no match for ‘operator>>’ in ‘std::cin >> password’ (operand types are ‘std::istream {aka std::basic_istream<char>}’ and ‘std::string [16] {aka std::basic_string<char> [16]}’)
foo.cpp:21:6: error: no match for ‘operator>>’ in ‘std::cin >> password2’ (operand types are ‘std::istream {aka std::basic_istream<char>}’ and ‘std::string [16] {aka std::basic_string<char> [16]}’)
foo.cpp:23:17: error: invalid operands of types ‘std::string [16] {aka std::basic_string<char> [16]}’ and ‘std::string [16] {aka std::basic_string<char> [16]}’ to binary ‘operator&’
foo.cpp:25:9: error: no match for ‘operator>>’ in ‘users >> password’ (operand types are ‘std::ofstream {aka std::basic_ofstream<char>}’ and ‘std::string [16] {aka std::basic_string<char> [16]}’) |
14: trying to use a non-existent variable
19,21: trying to read an array. Probably you intended to write
1 2 3 4
|
std::string usuario, password, password2;
std::cin >> usuario;
std::cin >> password;
std::cin >> password2;
|
note that the length of the strings is not limited
23: don't guess the syntax. I suppose that you want to compare the strings, so
if( password == password2 )
provided that you made the previous change
25: what ResidentBiscuit said
users << password
, the same applies to line 16.
Also, learn to indent.
Or better, don't. Simply let your IDE to handle that.
Edit:
output to file stream -> ofstream
input from file stream -> ifstream