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

Aptana radrails

Name: Anonymous 2008-02-08 23:36

I myself mostly an editor guy, have found Aptana studio and its plugin radrails to be fuckomg awsome, now just one question, at hand, mongrel skeleton, is there a better one?

Name: Anonymous 2008-02-09 10:18

HAY GUYS WHAT DO YOU THINK OF MY DOESCONTAIN FUNCTION?

(i cant create new threads so I am hijacking this one)


int doescontain(char *s, int (*is)(int)) {
  while(*s++)
    if(is(*s))
      return 1;
  return 0;
}

#include <ctype.h>
#include <stdio.h>

int main(int argc, char **argv) {

  printf("%d\n",argc);
  if(!argv[1]) {
    return 1;
  }

  if(doescontain(argv[1],isalpha))
    printf("contains alpha\n");
  if(doescontain(argv[1],isdigit))
    printf("contains digit\n");
  if(doescontain(argv[1],isupper))
    printf("contains upper\n");
  if(doescontain(argv[1],islower))
    printf("contains lower\n");

  return 0;
}

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