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-22 12:11

>>1-40
YHBT

Name: Anonymous 2009-04-22 13:07

>>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.

Name: Anonymous 2009-04-22 13:10

>>40
I never heard of casts.

Name: Anonymous 2009-04-22 13:32

(int) hax my anus!

Name: Anonymous 2009-04-22 13:37

>>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 :(

Name: Anonymous 2009-04-22 14:01

>>45
Fuck hax my anus! You hax my anus!.

Name: Anonymous 2009-04-22 14:03

:(
IHABT

Name: Anonymous 2009-04-22 14:04

>>47
IHABT
HMA

Name: Anonymous 2009-04-22 14:25

>>48
HMA my anus!

Name: Anonymous 2009-04-22 16:40

Please stop BUMPING. OP has been proven to be a retard.

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;

Name: Anonymous 2009-04-23 11:45

>>51
*as i abs()'d the result anyway

Name: Anonymous 2009-04-23 11:49

return((image_ptr)image); vs return (image_ptr)image;
LOL I can't believe you didn't fix this earlier.

Name: Anonymous 2009-04-23 12:02

OP here, I'm a massive faggot.

Name: Anonymous 2009-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...

Name: Anonymous 2009-04-23 14:30

>>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: Anonymous 2009-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: Anonymous 2009-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: Anonymous 2009-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: Anonymous 2009-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

>>59
you just got trolled

Name: Anonymous 2009-04-23 15:48

>>60
What are you, 12?

Name: Anonymous 2009-04-23 19:57

>>61
Color me moderately amused.

Name: Anonymous 2013-04-20 17:57

Name: Anonymous 2013-04-20 23:29



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

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