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

Pages: 1-

Q&A Time

Name: Anonymous 2010-04-10 17:56

If I write the code int i, j; can I assume that (&i + 1) == &j?

Only sometimes. It's not portable, because in EBCDIC, i and j are not adjacent.

Name: Anonymous 2010-04-10 18:00

Cool example OP, but i and j aren't initialised

Name: Anonymous 2010-04-10 18:03

>>2
(&i + 1) == &j initializes &j to &i+1.

Name: Anonymous 2010-04-10 18:09

who gives a flying shit about EBCDIC

Name: Anonymous 2010-04-10 18:11

>>3
You're an idiot of the highest order

Name: Anonymous 2010-04-10 18:12

>>1
because in EBCDIC, i and j are not adjacent.
Haha, very funny man. Why don't you just go eat a dish of your favourite food?

Name: Anonymous 2010-04-10 18:13

>>6
oh go fuck young asian chicks

Name: >>1 2010-04-10 18:19

Okay, I've had my fun.

I'm going to own up and point out that this was stolen from http://www.seebs.net/faqs/c-iaq.html

I'm astounded by >>2-3 (and to a lesser extent, >>4). I thought /prog/ was better than this.

Name: Anonymous 2010-04-10 18:21

>>7
hax my anus                                           

Name: Anonymous 2010-04-10 18:37

While it may be true on most modern arch's and compilers, why would you want to rely on this? Things can get more hairy if you have: char a;int b; alloced on the stack. A lot of modern compilers will use an int to store a for alignment/performance reasons, thus you can't use this trick. If you need reliable in-memory layout, use a struct, and use an implementation dependent pragma to force a certain alignment.

Name: Anonymous 2010-04-10 19:02

>>10
Yeah! You tell 'em!

Name: Anonymous 2010-04-10 19:36

>>9 is a fairly nice guy.

Name: Anonymous 2010-04-10 21:45

Name: Anonymous 2010-04-11 6:03

>>10
A non shit-post in /prog/?  This is mind-blowing.

Name: Anonymous 2010-04-11 6:39

>>14
I see someone hasn't been here at all this week.

Name: Anonymous 2010-04-11 9:56

>>14
A non-shit post in /prog/?  This is mind-blowing.
or
A non-shitpost in /prog/?  This is mind-blowing.

FTFY.

Name: Anonymous 2010-04-11 11:03

>>14,17
I bet it would happen a lot more often if you faggots stopped pretending this was such a world-shaking event every fucking time it happened.

Name: Anonymous 2010-04-11 11:25

>>18
... but >>10 is a shitpost.

Name: Anonymous 2010-04-11 11:40

>>18
>>17-san here, don't bring me into this! I was just being a pseudo-grammar nazi.

Name: Anonymous 2011-02-03 0:26

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