Original Post
SEEMS to be allocating just fine. Filling rbuf with values kills it. also crashes on DeleteRenderBuffers() I'm not a newb but this FAIRLY standard buffer implementation is driving me buggy. what very simple thing have missed? #include #include #include unsigned char ***rbuf; // to become rbuf[scrX][scrY][3] bool RBufsActive=FALSE; // to make sure we don't call one twice int scrX, scrY; // for the dynamic array int AllocRenderBuffers( void ) { int x, y; // we've been here without calling DeleteRenderBuffers() first if(RBufsActive==TRUE) return 0; // Allocate rbuf[x][y][3], the main render buffer if((rbuf=(unsigned char***)malloc(scrX*sizeof(unsigned char)))==NULL) return 0; for( x=0; x255 ) ch=0; // keeping ch in the 0-255 (unsigned char) range rbuf[x][y][c] = (unsigned char)ch; // fill it with something small } // we all know the "array value printout loop" lol for(x=0; x<scrX; x++) for(y=0; y<scrY; y++) for(c=0; c<3; c++) printf("%d ", rbuf[x][y][c] ); if(!DeleteRenderBuffers()) return(0); return(1); } getting the access violations at the line: rbuf[x][y][c] = (unsigned char)ch; ok am using: VS2005 4 gigs of ram and yes i should be spanked for my commenting. thanks guys in advance!