Q:

C program to copy .csv of integers copies one less element unless element size is set to +1

I'm new to learning the C language and I wanted to write a simple program that would copy an array integers from one .csv file to a new .csv file. My code works as intended, however when my array size for fread/fwrite is set to the exact number of elements in the .csv array (10 in this case), it only copies nine of the elements. 
When the array size is set to +1, it copies all the elements. 
#include <stdio.h>
#include <stdlib.h>

#define LISTSIZE 11
 //program that copies an array of integers from one .csv to another .csv

int main(int argc, char * argv[])
{
   if (argc != 2)
   {
        fprintf(stderr, "Usage ./file_sort file.csv\n");
        return 1;
   }
   char * csvfile = argv[1];
   FILE * input_csvile = fopen(csvfile, "r");   //open .csv     file and create file pointer input_csvile
   if(input_csvile == NULL)
   {
       fprintf(stderr, "Error, Could not open\n");
       return 2;
   }
   unsigned int giving_total[LISTSIZE];
   if(input_csvile != NULL)  //after file opens, read array from .csv input file
   {
       fread(giving_total, sizeof(int), LISTSIZE, input_csvile);
   }
   else
    fprintf(stderr, "Error\n");

   FILE * printed_file = fopen("school_currentfy1.csv", "w");

   if (printed_file != NULL)
   {
       fwrite(giving_total, sizeof(int), LISTSIZE, printed_file);  //copy array of LISTSIZE integers to new file
   }
   else
    fprintf(stderr, "Error\n");

   fclose(printed_file);
   fclose(input_csvile);

   return 0;

  }

Does this have something to do with the array being 0-indexed and the .csv file being 1-indexed? I also had an output with the LISTSIZE of 11 which had the last (10) element being displayed incorrectly; 480 instead of 4800. 
http://imgur.com/lLOozrc         Output/input with LISTSIZE of 10
http://imgur.com/IZPGwsA         Input/Output with LISTSIZE of 11

A:

Note: as noted in the comment, fread and fwrite are for reading and writing binary data, not text. If you are dealing with a .csv (comma separated values -- e.g. as exported from MS Excel or Open/LibreOffice calc) You will need to use fgets (or any other character/string oriented function) followed by sscanf (or strtol, strtoul) to read the values as text and perform the conversion to int values. To write the values to your output file, use fprintf. (fscanf is also available for input text processing and conversion, but you lose flexibility in handling variations in input format)
However, if your goal was to read binary data for 10 integers (e.g. 40-bytes of data), then fread and fwrite are fine, but as with all input/output routines, you need to validate the number of bytes read and written to insure you are dealing with valid data within your code. (and that you have a valid output data file when you are done)
There are many ways to read a .csv file, depending on the format. One generic way is to simply read each line of text with fgets and then repeatedly call sscanf to convert each value. (this has a number of advantages in handling different spacing around the ',' compared to fscanf) You simply read each line, assign a pointer to the beginning of the buffer read by fgets, and then call sscanf (with %n to return the number of character processed by each call) and then advance the pointer by that number and scan forward in the buffer until your next '-' (for negative values) or a digit is encountered. (using %n and scanning forward can allow fscanf to be used in a similar manner) For example:
/* read each line until LISTSIZE integers read or EOF */
while (numread < LISTSIZE && fgets (buf, MAXC, fp)) {

    int nchars = 0;     /* number of characters processed by sscanf */
    char *p = buf;      /* pointer to line */

    /* (you should check a whole line is read here) */

    /* while chars remain in buf, less than LISTSIZE ints read 
     * and a valid conversion to int perfomed by sscanf, update p
     * to point to start of next number.
     */
    while (*p && numread < LISTSIZE && 
            sscanf (p, "%d%n", &giving_total[numread], &nchars) == 1) {
        numread++;      /* increment the number read */
        p += nchars;    /* move p nchars forward in buf */
        /* find next digit in buf */
        while (*p && *p != '-' && (*p < '0' || *p > '9'))
            p++;
    }
}

Now to create your output file, you simply write numread values back out in comma separated value format. (you can adjust how many your write per line as required)
for (i = 0; i < numread; i++)   /* write in csv format */
    fprintf (fp, i ? ",%d" : "%d", giving_total[i]);
fputc ('\n', fp);   /* tidy up -- make sure file ends with '\n' */

Then it is just a matter of closing your output file and checking for any stream errors (always check on close when writing values to a file)
if (fclose (fp))        /* always validate close after write to */
    perror("error");    /* validate no stream errors occurred */

Putting it altogether, you could do something similar to the following:
#include <stdio.h>
#include <stdlib.h>

#define LISTSIZE 10
#define MAXC 256

int main(int argc, char *argv[])
{
    if (argc < 3) {
        fprintf(stderr, "Usage ./file_sort file.csv [outfile]\n");
        return 1;
    }

    int giving_total[LISTSIZE]; /* change to int to handle negative values */
    size_t i, numread = 0;      /* generic i and number of integers read */
    char *csvfile = argv[1],
        buf[MAXC] = "";         /* buffer to hold MAXC chars of text */
    FILE *fp = fopen (csvfile, "r");

    if (fp == NULL) {   /* validate csvfile open for reading */
        fprintf(stderr, "Error, Could not open input file.\n");
        return 2;
    }

    /* read each line until LISTSIZE integers read or EOF */
    while (numread < LISTSIZE && fgets (buf, MAXC, fp)) {

        int nchars = 0;     /* number of characters processed by sscanf */
        char *p = buf;      /* pointer to line */

        /* (you should check a whole line is read here) */

        /* while chars remain in buf, less than LISTSIZE ints read 
         * and a valid conversion to int perfomed by sscanf, update p
         * to point to start of next number.
         */
        while (*p && numread < LISTSIZE && 
                sscanf (p, "%d%n", &giving_total[numread], &nchars) == 1) {
            numread++;      /* increment the number read */
            p += nchars;    /* move p nchars forward in buf */
            /* find next digit in buf */
            while (*p && *p != '-' && (*p < '0' || *p > '9'))
                p++;
        }
    }
    if (numread < LISTSIZE) /* warn if less than LISTSIZE integers read */
        fprintf (stderr, "Warning: only '%zu' integers read from file", numread);

    fclose (fp);    /* close input file */

    fp = fopen (argc > 2 ? argv[2] : "outfile.csv", "w");  /* open output file */

    if (fp == NULL) {   /* validate output file open for writing */
        fprintf(stderr, "Error, Could not open output file.\n");
        return 3;
    }

    for (i = 0; i < numread; i++)   /* write in csv format */
        fprintf (fp, i ? ",%d" : "%d", giving_total[i]);
    fputc ('\n', fp);   /* tidy up -- make sure file ends with '\n' */

    if (fclose (fp))        /* always validate close after write to */
        perror("error");    /* validate no stream errors occurred */

    return 0;
}

Like I said, there are many, many ways to approach this. The idea is to build in as much flexibility to your read as possible so it can handle any variations in the input format without choking. Another very robust way to approach the read is using strtol (or strtoul for unsigned values). Both allow will advance a pointer for you to the next character following the integer converted so you can start your scan for the next digit from there.
An example of the read flexibility provide in either of these approaches is shown below. Reading a file of any number of lines, with values separate by any separator and converting each integer encountered to a value in your array, e.g.
Example Input
$ cat ../dat/10int.csv
8572, -2213, 6434, 16330, 3034
12346, 4855, 16985, 11250, 1495

Example Program Use
$ ./bin/fgetscsv ../dat/10int.csv dat/outfile.csv

Example Output File
$ cat dat/outfile.csv
8572,-2213,6434,16330,3034,12346,4855,16985,11250,1495

Look things over and let me know if you have questions. If your intent was to read 40-bytes in binary form, just let me know and I'm happy to help with an example there.
If you want a truly generic read of values in a file, you can tweak the code that finds the number in the input file to scan forward in the file and validate that any '-' is followed by a digit. This allows reading any format and simply picking the integers from the file. For example with the following minor change:
    while (*p && numread < LISTSIZE) {
        if (sscanf (p, "%d%n", &giving_total[numread], &nchars) == 1)
            numread++;      /* increment the number read */
        p += nchars;        /* move p nchars forward in buf */
        /* find next number in buf */
        for (; *p; p++) {
            if (*p >= '0' && *p <= '9') /* positive value */
                break;
            if (*p == '-' && *(p+1) >= '0' && *(p+1) <= '9') /* negative */
                break;
        }
    }

You can easily process the following file and obtain the same results:
$ cat ../dat/10intmess.txt
8572,;a -2213,;--a 6434,;
a- 16330,;a

- The Quick
Brown%3034 Fox
12346Jumps Over
A
4855,;*;Lazy 16985/,;a
Dog.
11250
1495

Example Program Use
$ ./bin/fgetscsv ../dat/10intmess.txt dat/outfile2.csv

Example Output File
$ cat dat/outfile2.csv
8572,-2213,6434,16330,3034,12346,4855,16985,11250,1495

