When compiled no compilation errors but force closes when taken input. Do i have to use double pointer? help me out please. Thank you
#include <stdio.h>
void main() {
int *a;
allocate(a);
input(a);
display(a);
}
void allocate(int *a){
a = malloc(sizeof(int)*3);
}
void input(int *a){
int i=0;
for(;i<3;i++){
scanf("%d",&a[i]);
}
}
void display(int *a){
int i=0;
for(; i<3;i++){
printf("%d",a[i]);
}
}