int *data;
data=calloc(3,sizeof(int));
int i=0;
for(i=0;i<3;i++)
scanf("%d",&data[i]);
for(i=0;i<3;i++)
printf("%d",data[i]);
free(data)
//i get segmentataion fault….
int *data;
data=calloc(3,sizeof(int));
int i=0;
for(i=0;i<3;i++)
scanf("%d",&data[i]);
for(i=0;i<3;i++)
printf("%d",data[i]);
free(data)
//i get segmentataion fault….
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
it will work fine…but u should try it using *(data+i) in the printf statement apart form the data[i] notation…