I think maybe you haven't got a good handle on how structures work. What youve set up is an array of employees, each with an age and an "a", whatever that is. You'd access the age of employee number 15 as Array[15].age. Look at the modification I made to your code and see if you can follow how it works.
Code:
#include <stdio.h>
#include <stdlib.h>
struct Employee{
int age;
int a;
};
int main(void){
int i, rows;
struct Employee *Array;
printf("Please type how big the array you want to be:\n");
scanf("%d", &rows);
Array = (struct Employee *)malloc(rows*sizeof(struct Employee));
/* Testing if everything went well */
for(i=0; i<rows; i++){
Array[i].age = i;
Array[i].a = 100+i;
printf("A[%d] age = %d\n", i, Array[i].age);
printf("A[%d] a = %d\n", i, Array[i].a);
}
system("PAUSE");
return 0;
}
H.