I can't find the error and the system always return the errors "ISO C++ forbids initialization of member `username' ", "making `username' static ", "invalid in-class initialization of static data member of non-integral type `std::string' " and the same with psword. Can anybody help me?
You shouldn't be assigning values in a header file, unless as the message says, the variable is static. You can use an initialiser list in a constructor though, in the .cpp file:
1 2 3 4
login::login() : // colon introduces initialiser list
username("Username"),
psword("Password")
{}
The implementation file (.cpp say) is the place to do ordinary assignment.
you don't initialize variables inside a class so string username = "Username"; should be string username; and string psword = "Password"; should be string psword;