defines an array that can contain only one characater.
The other problem is the statement
if(password == correctpassword)
Here two pointers are compared and the result is always equal to true because these pointers contain different addresses. You should use standard C function strcmp to compare two character arrays.
You already have #include <string> , why not just use a std::string to hold the password string entered by the user?
The user can enter any number of characters, and the string will resize itself to accept all of them.
And we can use an == to check if two strings compare equal.