Dear Programmers,

i have a question about splitting a textfile into an array. I have an textfile month.text which look like this:

"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","O CT","NOV","DEC"

Now, want i want is to read the file, split the "substrings" into an array, and put these name in alphabet order.

So, what is did is:
Code:
FILE *fp = NULL; 
fp = fopen("c:\\month.txt", "r");             //filename is month.txt, and the "r" for read
char c;
while((c = fgetc(input)) != EOF){
      if(c == ','){stop, and put it in an array, and make new array for the next month     }
     next character
}
How can i do this?

Best Regards,

Peter