How to under stand the C code


 
Thread Tools Search this Thread
Top Forums Programming How to under stand the C code
# 1  
Old 02-14-2007
How to under stand the C code

#include <stdio.h>

main(t,_,a)
char *a;
{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94, -27+t, a
)&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main(_,
t,"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+\
,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/\
+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){n\
l]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:t<-50?_==*a ?putchar(a[31]):main(-65,_,a+1):main((*a == '/')+t,_,a\
+1 ):0<t?main ( 2, 2 , "%s"):*a=='/'||main(0,main(-61,*a, "!ek;dc \
i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}
# 2  
Old 02-14-2007
That is obfuscated code with a recursive call to main(). It is deliberately messed up to be "funny". In short, it is not worth the effort to figure it out.

Plus, compilers wil generate lots of warnings. Code compiled with warnings is code that works thru coincidence.
# 3  
Old 02-14-2007
It may not be worth the effort, but it is pretty good. It compiled on my gcc 3.4.6 on Solaris 10 without any warnings and it prints the twelve days of Christmas.

Cheers
# 4  
Old 02-15-2007
Quote:
Originally Posted by brain_full
#include <stdio.h>

main(t,_,a)
char *a;
{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94, -27+t, a
)&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main(_,
t,"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+\
,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/\
+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){n\
l]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:t<-50?_==*a ?putchar(a[31]):main(-65,_,a+1):main((*a == '/')+t,_,a\
+1 ):0<t?main ( 2, 2 , "%s"):*a=='/'||main(0,main(-61,*a, "!ek;dc \
i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}
Now it's clear why your nickname is brain_full... Smilie
# 5  
Old 02-16-2007
Thought it was just a rubbish code designed to 'distract' people... amazing!!!! really!!! Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Network stand still

**this was posted in another forum I suspect wrong one moved here **:confused: Hello all. Let me qualify my question by saying that I am struggling with how to ask the question I am semi green but have no issue reading up if pointed in the right direction. Please be gentle! A RHEL server 6.2.... (4 Replies)
Discussion started by: rsheikh01
4 Replies

2. Shell Programming and Scripting

What does the -z expression stand for?

What does - z and {} means if ; then echo "ERROR: \$ARBORDBU environment variable is not set\n" (8 Replies)
Discussion started by: rafa_fed2
8 Replies

3. Shell Programming and Scripting

what does ${VARIABLE:-0} stand for?

Hi all, During reading the code, i met such expressment in a KSH script. I can not figure out what does this mean and don't know how to search it in the web. Could you please check below snippet and let me know what does this mean in a shell script: VARIABLE=1 if ; then .... (3 Replies)
Discussion started by: sleepy_11
3 Replies

4. HP-UX

Stand-alone start-up of HP-UX11i

I have a HP-UX11i machine on the network and that works fine. But, now i want to start this machine without network connection? How must i do this? Because, if i pull out the network cable it will not boot. (5 Replies)
Discussion started by: bavl
5 Replies

5. IP Networking

What does 'AF' of AF_INET stand for ?

as title. and how is it different from PF_INET ? also, any one knows sin_family , sin_port , sin_addr ..etc ? why are they called 'sin' ? finally, htons() host to network short , htonl() host to network long , ntohs() network to host short , ntohl() network to host long. why would... (6 Replies)
Discussion started by: trapeze
6 Replies

6. Solaris

update stand-by server

hi all , we are in the process of migrating from one system to another. i have some questions/concerns and i hope that u can help me with. 1) . we are in the process of merging to seperate system together , these applications run on 2 seperate sunfires . after the merge we will have one... (0 Replies)
Discussion started by: ppass
0 Replies

7. Shell Programming and Scripting

Can under stand the script

Hi all, I am working on following script which is already working and i am trying to understand but could not can any body help me in follwoing script. I understand that it deletes record from tables. using DB2 import from /dev/null. I dont know where in second portion it loads the data in to... (0 Replies)
Discussion started by: sam71
0 Replies

8. UNIX for Dummies Questions & Answers

Just curious, does Unix stand for anything?

If not, where did the name come from? (6 Replies)
Discussion started by: pudad
6 Replies

9. UNIX for Dummies Questions & Answers

OEM - what does this abbreviation stand for?

Just saw this OEM abbreviation during installation of Solaris 8. I'm curious to know what the letters stand for and what OEM actually is. (3 Replies)
Discussion started by: Kanu77
3 Replies

10. UNIX for Dummies Questions & Answers

No stand-by, keep on

How do you or what is the setup to keep the (server) up from shutting down? It is not server yet but it might very likely become to serve few clients. But, once I get in in the morning its off. It's Sparc, Solaris 8 and I would like to keep it running over night but once it is not attended it... (2 Replies)
Discussion started by: softarch
2 Replies
Login or Register to Ask a Question