示例#1
0
文件: E07.c 项目: CharlesGeng/study-c
int main()
{
    char mem[ARRAY_MAX_LENGTH];
    char *linePointer[MAX_LINES];
    int lines = myreadlines(linePointer, mem, MAX_LINES, ARRAY_MAX_LENGTH);
    int i;
    for (i = 0; i < lines; ++i)
        printf("%s", linePointer[i]);
    return 0;
}
示例#2
0
文件: sort_str.c 项目: Celthi/C
main()
{
	int nlines;
	char linestore[MAXSTORE]; /* array for storing all lines */
	/* myreadlines will pass an extra parameter linestore for storing all the input lines */
	if ((nlines = myreadlines(lineptr, MAXLINES, linestore)) >= 0)
	{
		qsort(lineptr, 0, nlines-1);
		writelines(lineptr, nlines);
		return 0;
	}
	else
	{
		printf("error: input too big to sort\n");
		return 1;
	}
}