I solved it like that
int64 Compare(CHAR c1, CHAR c2, bool ignoreCase = false)
{
return ignoreCase ? _strnicoll(&c1, &c2, 1) : _strncoll(&c1, &c2, 1);
}
int64 IndexOf(const CHAR* buffer, CHAR c, uint count, bool ignoreCase = false)
{
for (uint i =0; i < count; i++)
{
if (Compare(*(buffer + i), c, ignoreCase) == 0)
{
return i;
}
}
return npos;
}
int64 LastIndexOf(const CHAR* buffer, CHAR c, uint count, bool ignoreCase = false)
{
while(--count >= 0)
{
if (Compare(*(buffer + count), c, ignoreCase) == 0)
{
return count;
}
}
return npos;
}
npos = -1
and to specify the start index pass to (buffer + startIndex) as the buffer to the second or the third method