I want to allocate memory to an array in a structure.
struct str
{
int *num;
};
creat()
{
str s = malloc(sizeof(str));
s->num = (int*)malloc(5*sizeof(int));
}
But after execution of line s->num = (int*)malloc(5*sizeof(int));
, if I check, sizeof(s->num)
is still the same.
Am I missing something?