1
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.
2
Name:
Anonymous
2010-04-10 18:00
Cool example OP, but i and j aren't initialised
3
Name:
Anonymous
2010-04-10 18:03
>>2
(&i + 1) == &j initializes &j to &i+1.
4
Name:
Anonymous
2010-04-10 18:09
who gives a flying shit about EBCDIC
5
Name:
Anonymous
2010-04-10 18:11
>>3
You're an idiot of the highest order
6
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 di
sh of your favourite food?
8
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.
10
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.
16
Name:
Anonymous
2010-04-11 6:39
>>14
I see someone hasn't been here at all this week.
18
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.
20
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.