#include <stdio.h>
int main(){
    int a[4];
    int b[4],i;
    a[0] = 4;
    a[1] = 3;
    a[2] = 2;
    a[3] = 1;
    memcpy(&b, &a, sizeof(a));
    for (i = 0; i < 4; i++){
        printf("b[%d]:%d",i,b[i]);
    }
    printf("%d",sizeof(b));
}
ANS:
b[0]:4b[1]:3b[2]:2b[3]:116
Exited: ExitFailure 2
I'm getting the correct answers. But getting a exception as Exited: ExitFailure 2.
Is this way of copying the array datas using memcpy is wrong?
 
     
     
     
    