N
nolonger
Sample code:-
typedef struct __Y
{
int a;
char b[5];
} Y;
Y my_struct;
Y *my_ptr_struct;
void my_func (char *str);
main
{
my_ptr_struct = &my_struct;
my_func(&my_struct.b);
my_func(&my_ptr_struct->b);
}
Both func calls gave me compiler warnings of pointer mismatch. So I
changed to (char *) &my_struct.b and (char *) &my_ptr_struct.b. Is
this correct passing of pointers to members?
Thank-you.
typedef struct __Y
{
int a;
char b[5];
} Y;
Y my_struct;
Y *my_ptr_struct;
void my_func (char *str);
main
{
my_ptr_struct = &my_struct;
my_func(&my_struct.b);
my_func(&my_ptr_struct->b);
}
Both func calls gave me compiler warnings of pointer mismatch. So I
changed to (char *) &my_struct.b and (char *) &my_ptr_struct.b. Is
this correct passing of pointers to members?
Thank-you.