Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

acessing a 1D array with row/col

Name: Anonymous 2009-04-21 8:27

imagePtr[i*cols + j]
where i and j are the row/col coordinates. this isn't right, i can't remember how else to do it. i know it's something LIKE this, just not exactly what, and google isn't cooperating. do i need to use the memory locations?

Name: Anonymous 2009-04-23 11:34

op here, returning after >>33 (anyone purporting to be me after that point was just imitating). you are all a bunch of faggots. the problem was the maxval variable coming in as 448 instead of 256, due to my skipping over of two getnum() calls.

anyone know why this would cause a fucking segfault? i can't figure it, especially as i maxval'd the result anyway. it really does work now, produced exactly the desired results with just adding two 'getnum(*fp);' to the function that had been responsible for getting the maxval (otherwise it is the same code as in >>20, with the return fixed). one thing i did was couch the cast in addition brakcets but i don't think that would actually have any effect (was kinda desperately testing everything, which is when i did the printf("%d", maxval) and saw the problem). like return((image_ptr)image); vs return (image_ptr)image;

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List