linuxuser 0 Report post Posted June 16, 2004 (edited) Check out some of these C codes I found in the Web!!! Simply amazing. No wonder C is a cooool language. 1) #include <stdio.h> int main() { int a=3, b = 5; printf(&a["Ya!Hello! how is this? %s\n"], &b["junk/super"]); printf(&a["WHAT%c%c%c %c%c %c !\n"], 1["this"], 2["beauty"],0["tool"],0["is"],3["sensitive"],4["CCCCCC"]); return 0; } 2) #include <stdio.h> int main() { int i = 6; if( ((++i < 7) && ( i++/6)) || (++i <= 9)) ; printf("%d\n",i); return 0; } 3) #include<stdio.h> #include<ctype.h> char t[]={ 0,0,0,0,0,0,12,18,33,63, 33,33,62,32,62,33,33,62,30,33, 32,32,33,30,62,33,33,33,33,62, 63,32,62,32,32,63,63,32,62,32, 32,32,30,33,32,39,33,30,33,33, 63,33,33,33,4,4,4,4,4,4, 1,1,1,1,33,30,33,34,60,36, 34,33,32,32,32,32,32,63,33,51, 45,33,33,33,33,49,41,37,35,33, 30,33,33,33,33,30,62,33,33,62, 32,32,30,33,33,37,34,29,62,33, 33,62,34,33,30,32,30,1,33,30, 31,4,4,4,4,4,33,33,33,33, 33,30,33,33,33,33,18,12,33,33, 33,45,51,33,33,18,12,12,18,33, 17,10,4,4,4,4,63,2,4,8, 16,63 }; int main(int argc,char** argv) { int r,pr; for(r=0;r<6;++r) { char *p=argv[1]; while(pr&&*p) { int o=(toupper(*p++)-'A')*6+6+r; o=(o<0||o>=sizeof(t))?0:o; for(pr=5;pr>=-1;--pr) { printf("%c",( ( (pr>=0) && (t[o]&(1<<pr)))?'#':' ')); } } printf("\n"); } return 0; } 4) #include<stdio.h> #define f ( a, b ) a##b #define g(a) #a #define h(a) g(a) int main() { printf("%s\n",h(f(1,2))); printf("%s\n",g(f(1,2))); return 0; } Edited June 16, 2004 by rs_1915 Quote Share this post Link to post Share on other sites
Bhaskar 0 Report post Posted July 19, 2004 I think it is ugliness, rather than beauty of C. Quote Share this post Link to post Share on other sites
linuxuser 0 Report post Posted July 19, 2004 Bhaskar, u think C++ syntax is ugly or language itself is ugly?? could u explain bit more and what languages u like the most? i noticed u r CS major. Quote Share this post Link to post Share on other sites
Bhaskar 0 Report post Posted July 20, 2004 QUOTE (rs_1915 @ Jul 19 2004, 06:18 PM) Bhaskar, u think C++ syntax is ugly or language itself is ugly?? could u explain bit more and what languages u like the most? i noticed u r CS major. C as said by its creator is an elegant programming language. I agree with that. The syntax of C++ is elegant too. But people make it ugly. Writing hard to read programs is often easy in C and C++. I believe in writing readable programs. The language that I like most is without doubt C and C++. Quote Share this post Link to post Share on other sites
linuxuser 0 Report post Posted July 20, 2004 QUOTE Writing hard to read programs is often easy in C and C++. I believe in writing readable programs. Readable programs are good. But i like to explore the power of C/C++. I dont see any fun in straight forward codes. Quote Share this post Link to post Share on other sites