c - What does "request for member '*******' in something not a structure or union" mean? -
Is there an easy explanation for what this error means?
request for member * * ****** Some do not have a structure or association
I have faced many times at that time I am learning, but I have not found it means that what it means.
This also happens when you are trying to use an example when you are an indicator Is, and vice versa:
struct foo {int x, y, z; }; Structure Foo A, * B = & amp; a; Bx = 12; / * This will generate error, B-> Must be x or (* b) X * /
As mentioned in a comment, if it goes to someone then it can be extremely intense and typedef
sa pointers, i.e. < In a typedef in code> * , such as:
typedef struct foo * Foo;
Because then you get the code that looks as it is dealing with examples, when in fact it is dealing with indicators:
Foo A_foo = get_a_brand_new_foo (); A_foo-> Field = FANTASTIC_VALUE;
Notice how the above appears as if it should be written as a_foo.field
, but it will fail because since Foo
An indicator is struct. I strongly recommend against typedef
: Ed pointers are important in C, do not hide their stars, they shine.
Comments
Post a Comment