All pastes #2058642 Raw Edit

Miscellany

public text v1 · immutable
#2058642 ·published 2011-05-14 01:17 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int strptrcmp(const void *sp1, const void *sp2);

void alphasort() {
  FILE *fp = fopen("short","r");
  int i = 0;

  char buf[256];
  char *word;
  char *line[10][256];

  while (fgets(buf,sizeof(buf),fp) != NULL) {
    word = strtok(buf,"\n");
    printf("line[%d] = %s", i , line[i]);
    i++;
  }
   printf("line1: %s\n", *line[2]);
   printf("line2: %s", *line[3]);
   // qsort(line, sizeof(line), sizeof(char*), strptrcmp);


}

int main() {
  alphasort();
  return 0;
}