Dynamic array of integers: another attempt This is follow up to this one. In the previous some minor errors slipped, so I couldn't update the code. Also took some advice.
So final version is below.

header:

#define DEFAULT_CAPACITY 1000

// Define a vector type
typedef struct 
{
  int nrOfElements; // This just denotes current number of elements.
  int capacity;     // This denotes the capacity of the array.
  int *data;        // Actual pointer to array elements.    
} CVectorInt;

typedef enum {VECTOR_SUCCESS, VECTOR_OUTOFBOUNDS, VECTOR_MEMORYERROR, VECTOR_LIMITEXCEEDED} vector_status;

vector_status CVectorInit(CVectorInt *vector);
vector_status CVectorAppend(CVectorInt *vector, int value);
vector_status CVectorGet(CVectorInt *vector, int index, int * value);
vector_status CVectorSet(CVectorInt *vector, int index, int value);
void CVectorFree(CVectorInt *vector);


source:

#include "CVectorInt.h"
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

///
// Initialize vector.
//  Set capacity to default value. Current number of elements to 0.
//  Allocate memory dynamically for the default number of elements.
//
//
// Return
//  If there is some problem, error code is returned.
//
vector_status CVectorInit(CVectorInt *vector)
{
    int i = 0;

    vector-&gt;capacity = DEFAULT_CAPACITY;
    vector-&gt;nrOfElements = 0;

    // Allocate array
    vector-&gt;data = malloc(sizeof(int) * vector-&gt;capacity);
    if(vector-&gt;data == NULL)
        return VECTOR_MEMORYERROR;

    // Initialization the array to default values.
    for(i = 0; i &lt; DEFAULT_CAPACITY; i++)
        vector-&gt;data[i] = 0;

    return VECTOR_SUCCESS;
}

vector_status CVectorAppend(CVectorInt *vector, int value) 
{
    int * ptr = NULL;
    int i = 0;

    if(vector-&gt;capacity == 32000)
        return VECTOR_LIMITEXCEEDED;

    // Do we have room to append elements?
    if(vector-&gt;capacity &lt;= vector-&gt;nrOfElements)
    {
        // No, increase capacity
        vector-&gt;capacity *= 2;

        // Resize array
        ptr = realloc(vector-&gt;data, vector-&gt;capacity * sizeof(int));
        if(ptr == NULL)          
        {       
            // We had an error
            return VECTOR_MEMORYERROR;
        }
        else
        {
            vector-&gt;data = ptr; 

            // Initialize only new elements to 0.
            for(i = vector-&gt;nrOfElements; i &lt; vector-&gt;capacity; i++)
                vector-&gt;data[i] = 0;
        }
    }

    // Now, after possible resize, add the element.
    vector-&gt;data[vector-&gt;nrOfElements++] = value;

    return VECTOR_SUCCESS;


}

vector_status CVectorGet(CVectorInt *vector, int index, int * value)
{
    // Is the index within bounds?
    if(index &lt; vector-&gt;nrOfElements &amp;&amp; index &gt;= 0)
    {
        *value = vector-&gt;data[index];
        return VECTOR_SUCCESS;
    }else
    {
        return VECTOR_OUTOFBOUNDS;
    }
}

vector_status CVectorSet(CVectorInt *vector, int index, int value)
{
    // We can't set outside capacity
    if(index &gt;= vector-&gt;capacity || index &lt; 0)
        return VECTOR_OUTOFBOUNDS;

    // zero fill the vector up to the desired index
    while(vector-&gt;nrOfElements &lt;= index)
        CVectorAppend(vector, 0);

    vector-&gt;data[index]=value;
}


void CVectorFree(CVectorInt *vector)
{
  // Free underlying array
  free(vector-&gt;data);
}
Your entire CVectorInit function can essentially be trimmed down to this:

vector_status CVectorInit(CVectorInt *vector)
{
    vector-&gt;capacity = DEFAULT_CAPACITY;

    // Allocate array
    vector-&gt;data = calloc(vector-&gt;capacity, sizeof(int));
    if(vector-&gt;data == NULL)
        return VECTOR_MEMORYERROR;

    return VECTOR_SUCCESS;
}


Fundamentally though, is there a reason to zero out the allocated array? You make sure that you never access an index that's out of bounds in your functions so there should be no need to zero out the allocated array. Especially on resizing the vector, this will just be a performance hit that you'll take with little benefit (especially when the vector gets to be quite large).

Moreover, I would replace the ints holding the size and capacity of the vector with size_t or something similar. These values are never going to hold negative numbers so there's no need to have them as signed ints.

Also, there seems to be this magic constant 32000. Why is it 32k and what's the reasoning? Create a named variable for this constant. So in your .c file:

static const size_t MAXIMUM_CAPACITY = 32000;

Also, why is that value so low? A standard signed int can hold a maximum value of around 2 billion so 32k seems pretty low. Maybe putting a comment above that named variable to justify your reason could be helpful.

As a design consideration, you might want to think whether or not you want to have DEFAULT_CAPACITY declared as a macro in your header file. As it is, someone could go to your header and set DEFAULT_CAPACITY to a negative value or some other erroneous number. Assuming that you might be compiling this as some sort of library, it might be better to declare DEFAULT_CAPACITY as a private variable to your implementation file to avoid such things:

In your .c file:
static const size_t DEFAULT_CAPACITY = 1000;

This also comes with the added benefit of type safety and avoiding the use of the preprocessor.