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

Code that may or may not pass muster

Name: Anonymous 2009-10-01 2:42

I know we've got some computer science students in here, and I know you've written some questionable code at 2:30 in the morning before your project is due. So post it here! Preferably one-liners. Here's mine. I'm interested to see what my prof thinks of it... opinions could differ.

printf("%.1f%c", *e, (0 == (e - matrix + 1) % size)?'\n':'\t');

Name: Anonymous 2009-10-01 12:35

i wrote this today.
i don't think it's actually very bad, but i felt kinda bad about it because i've always been told that gotos are bad mojo.

while((c = getchar()) != EOF){
   int i;
   for(i = 0; i < str1_len; ++i){
      if(c == str1[i]){
         goto next_outer;
      }
   }
   putchar(c);
   next_outer:;
}


in case you're wondering, what it does is prettymuch the same as tr -d

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