The closest thing I have is a way to sort arguments themselves, like so:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main (int argc, char *argv[])
{
int i, comp;
for(i = 0; i < argc; i++)
{
if((comp = strcmp(argv[i],"c"))==0)
{
printf("Here is an argument: %s",argv[i]);
else if (comp < 0)
printf("%s is less than 'c'", argv[i]);
else if (comp > 0)
printf("%s is greater than 'c'", argv[i]);
}
return 0;
}
The text file that will be fed in as an argument can be sorted by it's first letter, or whatever is easiest, the part that matters is reading in the file and printing to STDOUT.
Thanks a lot guys and gals of <DIC/>
-G

New Topic/Question
Reply




MultiQuote




|