deep confuse with pointer
Hi,
I am deeply confuse with pointer after so many reading
Pointer is variable that hold memory location of variable. variable may be a different type like int, char, float..
I am confused with pointer to structure.
Code:
#include<stdio.h>
struct structure_name
{
int i;
char c;
float f;
struct structure_name * n;
}
int main ()
{
struct structure_name * structure_variable = NULL;
structure_variable = malloc (sizeof(structure_variable));
structure_variable->i;
structure_variable->c;
structure_variable->f;
return 0;
}
Does pointer store the memory location of structure or location of structure member?
structure_variable->i; Pointer hold the memory location of structure member i variable i is integer variable