From: Jeff Woods <Kazrak+kernel@cesmail.net>
To: Charlie Gordon <gmane@chqrlie.org>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Some question about one method.
Date: Mon, 24 May 2004 18:06:30 -0600 [thread overview]
Message-ID: <6.0.1.1.0.20040524175732.02d159a0@no.incoming.mail> (raw)
In-Reply-To: <c8u049$b00$1@sea.gmane.org>
At 5/25/2004 01:24 AM +0200, Charlie Gordon wrote:
>>char *a;
>>short *b;
>>int *c;
>>long *d;
>>long long *e;
>>
>>--> What's the difference between a++ and e++?
>
>it makes them point to the next element in the arrays of respective types,
>and as such increments the binary value by a different amount.
>
>More interestingly what is the difference between e[5] and 5[e] ?
Since pointer addition is commutative [i.e., *(e+5) == *(5+e) ] they're the
same thing.
My favorite C obfuscation. (And I only use it when I intend to be obtuse!
:) Note below that "j" is an int and "t" is an array of char and there's a
"putchar(j[t])" in there. [Yes, it compiles and runs.]
--
int main(void){int j=2003;/*(c)2003 cishikawa.*/
char t[]="+<WJ> @abcdefghijklmnopqrstuvwxyz.,\n\"";
char*i="y>b<+x,m+tie@.juswndnc@dt<Wupi\"JWhysbJirviiy";
while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1),
(putchar(j[t])));return 0;}/* under GPL */
next prev parent reply other threads:[~2004-05-25 0:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-21 10:24 Some question about one method Alphex Kaanoken
2004-05-21 21:17 ` Jan-Benedict Glaw
2004-05-24 8:06 ` Charlie Gordon
2004-05-24 17:30 ` Jan-Benedict Glaw
2004-05-24 23:24 ` Charlie Gordon
2004-05-25 0:06 ` Jeff Woods [this message]
2004-05-25 0:41 ` Glynn Clements
-- strict thread matches above, loose matches on Subject: below --
2004-05-21 10:54 Ranga Reddy M - CTD ,Chennai.
2004-05-21 21:19 ` Jan-Benedict Glaw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6.0.1.1.0.20040524175732.02d159a0@no.incoming.mail \
--to=kazrak+kernel@cesmail.net \
--cc=gmane@chqrlie.org \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).