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?
>>35
I don't give a shit. GO READ A MOTHERFUCKING BOOK. If you can't be arsed to do that little then programming is not for you (in C especially, [prog]PHP[/prog] maybe). Go to some rentacoder site and hire someone to write it for you.
>>43
No you fucktard. I wondered what the fuck does he want to accomplish by overwriting a local variable at the end of the function. Not to mention that the memory at image wasn't even allocated using new/malloc. Also, IHBT:(
PleasestopBUMPING. OP has been proven to be a retard.
Name:
Anonymous2009-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;
return((image_ptr)image); vs return (image_ptr)image;
LOL I can't believe you didn't fix this earlier.
Name:
Anonymous2009-04-23 12:02
OP here, I'm a massive faggot.
Name:
Anonymous2009-04-23 12:17
>>53
is that really what was causing it? i thought return had to evaluate all attached operands first? and what is a cast anyway, isn't it an operation (how would you return it)? and none of it explains how the function was able to get partial operation...
>>51 anyone purporting to be me after that point was just imitating
Riiight. anyone know why this would cause a fucking segfault?
Because you're still an idiot.
Name:
Anonymous2009-04-23 15:29
no one on /prog/ actually knows anything. this isn't a gauntlet, it is what i have determined after visiting a few times and making a few posts.
Name:
Anonymous2009-04-23 15:34
>>57
BULLSHIT, I, for one, know how to to write:
* factorial
* fibs
* Löb
* an ANSI C compiler in ANSI C
Name:
Anonymous2009-04-23 15:35
>>57
you just don't get /prog/. But let me enlighten you, I come here to troll and to generally act like an idiot. It's a great way to relax after a hard days coding. The reason no-one helps anyone is because the majority of problems posted here are trivial and solvable by not being an idiot (this may or may not include using google). If after ``visiting a few times '' you don't get that, you shouldn't be here or anywhere else on the internet (except maybe /pr/)
tl;dr
Like it or lump it
Name:
Anonymous2009-04-23 15:44
>>58 an ANSI C compiler in ANSI C
i'm actually taking this course next semester, very much looking forward to it