1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifndef lint
   8: char copyright[] =
   9: "@(#) Copyright (c) 1980 Regents of the University of California.\n\
  10:  All rights reserved.\n";
  11: #endif not lint
  12: 
  13: #ifndef lint
  14: static char sccsid[] = "@(#)comp.c	5.1 (Berkeley) 5/30/85";
  15: #endif not lint
  16: 
  17: #include <stdio.h>
  18: #define MAX ' '
  19: 
  20: char new[MAX], old[MAX];
  21: 
  22: main ()
  23: {
  24:     register int i, j;
  25:     old[0] = '\0';
  26:     while (fgets(&new[0], MAX, stdin) != NULL) {
  27:         for (i=0; i<MAX && old[i]==new[i]; i++);
  28:         if (i >= MAX) {
  29:             fprintf(stderr, "long word\n");
  30:             exit(1);
  31:         }
  32:         putc(i, stdout);
  33:         for (j=0; (old[j]=new[j]) != '\n'; j++);
  34:         old[j] = '\0';
  35:         fputs(&old[i], stdout);
  36:     }
  37: }

Defined functions

main defined in line 22; never used

Defined variables

copyright defined in line 8; never used
new defined in line 20; used 3 times
old defined in line 20; used 5 times
sccsid defined in line 14; never used

Defined macros

MAX defined in line 18; used 5 times
Last modified: 1985-05-31
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2731
Valid CSS Valid XHTML 1.0 Strict