c insert a pointer to an array

You forgot to increment the size :

void insert (int max, int *size, int ar[], int num)
    {
        if(*size>=MAX)
        {
            printf("Array full")
        }
        else
        {
            ar[*size] = num;
            (*size)++;
        }
    }

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top