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

newfags can't

Name: Anonymous 2012-10-07 19:34

SUPERBOLD

Name: Anonymous 2013-05-21 2:59

>>29
That's terrible. It doesn't hit all of the ASCII set, it gets the brackets wrong, it uses too much memory and has a hardcoded limit... I'm so ashamed to be on the same board as that that I have to post an improved version.


#include <locale.h>
#include <stdio.h>

int main(void)
{
  int c;

  if (setlocale(LC_ALL, "") == NULL)
    return -1;

  while (EOF != (c = getchar())) {
    if (c <= '~' && c >= '`')
      printf("%c%c%c", -17, -67, (-128 + (c - '`')));
    else if (c < '`' && c >= '!')
      printf("%c%c%c", -17, -68, (-128 + (c - ' ')));
    else
      printf("%c", c);
  }
}


Lrn2Un1[0d3, n00b!

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