You can use contact_details[x][0] here - no need for the .c_str() as the [] operator is defined for std:string as you would expect - ie. it returns the specified character.