Em có đoạn code sau :
# include <stdio.h>
# include <stdlib.h>
# include <conio.h>
void main ()
{
int *num, i,j=0;
printf ("Enter the number of element :
");
scanf("%d",&i);
num=(int *) malloc (i*sizeof(int));
printf ("
Enter data
");
for (j=0;j<=i;j++)
{
scanf("%d",(num+j));
}
printf("
");
for (j=0;j<=i;j++)
printf("%d ",*(num+j));
getch();
free(num);
}
Cứ chạy tới hàm free la nó báo lỗi em không hiểu tại sao cả ạ !