<!-- hamlet
<!-- copytar
examples/                                                                                           0040755 0002611 0000666 00000000000 06355553044 0013537 5                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        examples/stringcheck.c                                                                              0100644 0002611 0000666 00000001375 06355553037 0016214 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 3 */
/* Template for string function checkoff

Created:  Joe Zachary, November 5, 1992
Modified:

*/

#include <stdio.h>
#include <string.h>

void main () {

/* First we declare three strings of ample size. */

  char s1[200];
  char s2[200];
  char s3[400];


/* Next we read in values for s1 and s2. */

  printf("Please enter a line of text: ");
  gets(s1);
  printf("Please enter a line of text: ");
  gets(s2);


/* Next we combine the strings and print out the result. */

/* YOUR CODE GOES HERE. */

  printf("The combined lines are %s\n", s3);


/* Next we tell the user whether s1 or s2 is longer. */

/* YOUR CODE GOES HERE. */


/* Finally we tell the user which lines comes earlier in
   lexicographic order. */

/* YOUR CODE GOES HERE. */


}
                                                                                                                                                                                                                                                                   examples/stringinit.c                                                                               0100644 0002611 0000666 00000000354 06355553041 0016071 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 3 */
/* Illustrates null-termination.

Created:  Joe Zachary, November 5, 1992
Modified:

*/

#include <stdio.h>

void main () {
  int i;
  char s[10] = "Hello";
  for (i=0; i<10; i++)
    {
      printf("%d\n", s[i]);
    }
}
                                                                                                                                                                                                                                                                                    examples/stringio.c                                                                                 0100644 0002611 0000666 00000000371 06355553042 0015535 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 3 */
/* Illustrates the "gets" and "puts" functions

Created:  Joe Zachary, November 5, 1992
Modified:

*/

#include <stdio.h>

void main () {
  char s[200];
  printf("Please enter a string: ");
  gets(s);
  printf("%s\n", s);
  puts(s);
}
                                                                                                                                                                                                                                                                       examples/stringscan.c                                                                               0100644 0002611 0000666 00000000605 06355553041 0016051 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 3 */
/* Illustrates the %s scanf directive

Created:  Joe Zachary, November 5, 1992
Modified:

*/

#include <stdio.h>

void main () {
  char t[8] = "Hello";
  char s[8];
  int i;
  printf("Please enter a string: ");
  scanf("%s", s);

  for (i=0; i<8; i++)
    {
      printf("%d\n", s[i]);
    }
  
  printf("The value of s is %s\n", s);
  printf("The value of t is %s\n", t);
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           