You still have array of samples, the question is how you address individual values. This is how you do it:
const UCHAR* pnSamples = ...
if(bMono)
{
for(INT nIndex = 0; ...)
{
const UCHAR nSample = pnSamples[nIndex];
// ...
}
} else
if(bStereo)
{
for(INT nIndex = 0; ...)
{
const UCHAR nLeftSample = pnSamples[2 * nIndex + 0];
const UCHAR nRightSample = pnSamples[2 * nIndex + 1];
// ...
}
}