hi i have a code here iam trying to dynamic allocate memory for my structure how can i do that i try doing it this way but it wont compile. helpp please
Code:#include<stdio.h> #include<stdlib.h> #include<conio.h> struct student { char name[20]; int id; }; main() { struct student *info; int x; printf("how many student"); scanf("%i",&x); info=(struct*)malloc(sizeof(struct)*x); getch(); }



LinkBack URL
About LinkBacks



