// returns the value of this preference at index 0
ifail = PREF_ask_char_value("ProcessAdmin", 0, &adminGrpRle);
CHECK_IFAIL(ifail);
string adminStrng = string(adminGrpRle);
posn = adminStrng.find(COLON_SEPARATOR);
if (posn != string::npos)
{
grp = adminStrng.substr(0,posn);
rle = adminStrng.substr(posn+1, string::npos);
groupRoleMap.insert(pair<string, string>(grp, rle));
}
PREF_ask_char_value is a function API that returns a *char - adminGrpRle. In this case it's value is: 0x7ff45060"Process:process_admin"
Value of posn returned is 7 - which is also correct.
I need to split this returnd character string into two strings - Process and process_admin. However the two string variables grp and rle only show <Bad Ptr>.