cudaMemset

Hello,

Im having a run time error when im tring to run this code:

unsigned char *BuffArr[iNumBuffers];

for (int i = 0; i < iNumBuffers; ++i){

			CUDA_CHK_ERR_THROW ( cudaMallocPitch((void **)(BuffArr + i), &iLineStep, iWidth*iBytesPerPixel, iHeight) );

			CUDA_CHK_ERR_THROW ( cudaMemset	((void *)(BuffArr + i),0,iLineStep*iHeight));

The cudaMallocPitch is working fine, but there is something wrong with my cudaMemset call.

Can you please advise?

Thanks!

CUDA_CHK_ERR_THROW ( cudaMemset	((void *)(BuffArr[i]),0,iLineStep*iHeight));