ccalloc

why I get strange value after using calloc function in c when i print each element and print the whole value?


I'm new to see and just experimenting some function of it. I came across calloc() function. I wonder why the whole variable printed, is not same as each of the indexes . shouldn't the variable value be 0?

#include "stdio.h"
#include "stdlib.h"

int main()
{
    int *array;
    array = calloc(100,sizeof(int));
    printf("%d\n",array);
    for(int i  = 0 ; i<sizeof(array);i++)
    {
        printf("%d\n", array[i]);
    } 
    free(array);
}

and the output is

-1300734400
0
0
0
0
0
0
0
0

I expected that the value printed in the printf("%d\n",array); would be zero


Solution