You should use std::string::substr
. Subtracting strings like that is invalid.
firstName = employeeName.substr(0, employeeName.find(" "));
The first parameter is the starting index of the substring you want to extract and the second parameter is the length of the substring.