struct dereference operator

given

1
2
3
4
5
typedef struct ex1
{
   int i;
   void* p;
}struct_ex1;


is (struct_ex1)->i equivalent to struct_ex1.i ?
Last edited on
no. struct_ex1 is an alias of ex1. The first way would not compile.
(*struct_ex1).i
is equivalent to
struct_ex1->i


Given that struct_ex1 is a pointer
Last edited on
Topic archived. No new replies allowed.