unsignedchar * p,end;
p = *pBitmap;
end = *p+(bmpfile->dib.raster_size-1);
bmpfile->dib.raster_size is 33554432
p is 0x600020 '\377' <repeats 8188 times>, "\276q\276q"
p should point to begin of the string. I expect that if I add
33554432-1 to p so it should point to last character of *pBitmap.
But I don't think it works.
*p refers to 255 '\377' (I think it means it points to 256th position). But end points to 254 'ţ' which should not be so. I expect *p should point to 0th element of char array and end should point to 33554432th element, so I should rather see something like end to be 33554431 '\377' ... So how what I do wrong?
There are two thing which are wrong with your code:
1) You do not need to dereference starting pointer. Just add buffer size to it and you will get end pointer.
2) To get value of pointer, you need to cast it to void*. Otherwise it will be threated ass a c-string which it is not.