Hello everyone~!
I have a text file with integers on every line like:

2397
4013
9382
5995
4961
9961
1535
146
8153
3877
5872
2690
9731
8060
8452
7873
1109
4152
7256
2437
6815
2032
2473
1090
5674
6096
7868
422

My problem is: Im not sure how to store the information so i can sort it. I was able to get the information out of the txt file but when i sort it, the sort does not work. (the way i got the information is bad?)

 char temp[50] = {0};
    //get input store it in the array
          //array should be filled
          for(i=0;i<sizeof(sortArray);i++)
          {
              while(!feof(inFile))
              {
               fgets(temp,sizeof(temp),inFile);
                strcat(sortArray,temp);
              }
          }

Where do i start?

I should use an integer array, and then use fscanf for to get input?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.