In c++ we use either cin or getline() to get characters from the keyboard, and you have to allocate the buffer yourself
Use this if the password contains no spaces
std::string saltedPassword;
std::cin >> saltedPassword;
if the password contains spaces then it's like this:
std::string saltedPassword;
std::getline(std::cin, saltedPassword);
In both cases you have to include the standard c++ header files <string> and <iostream>