F
fmassei
Hello,
I'm have a question about forward structure declarations and
incomplete types. The complete structure of my file is pretty complex,
but just as an example the code below will explain the problem:
struct b;
struct a {
struct b m;
};
struct b {
struct a m;
};
This code won't compile: my compiler (gcc) says that a.m "has
incomplete type". Changing the members' types to structure pointers
works, but it will be nicer if I could do this as if the two
definitions were not "cross-defined".
Is there a way for doing this?
I'm have a question about forward structure declarations and
incomplete types. The complete structure of my file is pretty complex,
but just as an example the code below will explain the problem:
struct b;
struct a {
struct b m;
};
struct b {
struct a m;
};
This code won't compile: my compiler (gcc) says that a.m "has
incomplete type". Changing the members' types to structure pointers
works, but it will be nicer if I could do this as if the two
definitions were not "cross-defined".
Is there a way for doing this?