All pastes #2000245 Raw Edit

enol / capitalize

public c v1 · immutable
#2000245 ·published 2010-11-23 21:14 UTC
rendered paste body
#include <ctype.h>#include <stdio.h>char *caps (char *s);intmain (int argc, char **argv){  if (argc != 1)    printf ("%s\n", caps (argv[1]));  return 0;}char *caps (char *s){  char *sp = s;  *(sp) = toupper (*sp);  for (++sp; *sp; sp++)    if (!isgraph (*(sp - 1)) || !isgraph (*(sp + 1)))      *sp = toupper (*sp);  return s;}