[ create a new paste ] login | about

Link: http://codepad.org/sSRCwvt2    [ raw code | output | fork ]

C, pasted on May 19:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAXWORD 50    /* max word length */
#define SIZE 1000    /* array size */

void sort_words(char [][MAXWORD], int);
void string_swap(char **, char **);
int main()
{
  char w[SIZE][MAXWORD];
    /* array of fixed length strings */ 
  int num, i;

  for (i=0; scanf("%s", w[i]) == 1; i++){
    if (i >= SIZE) {
      printf("Too many Words!");
      exit(1);
    }
  }
  num = i;
  sort_words(w, num);
  for (i=0; i < num; i++)
    printf("%s\n", w[i]);

  return 0;
}


Output:
1
2
In function `main':
undefined reference to `sort_words'


Create a new paste based on this one


Comments: