M
Mark
I'm wondering if it is OK to declare incomplete type like this:
/* foo.h */
#ifndef FOO_H
#define FOO_H
typedef struct foo foo_t;
#endif
/* foo.c */
#include "foo.h"
struct foo {
int x;
int y;
};
...
Or it is necessary to make forward structure declaration, as in:
/* foo.h */
struct foo;
typedef struct foo foo_t;
while 'foo.c' defines the structure members and the like. What's the big difference with these? They compile perfectly well.
Thanks in advance.
--
Mark
/* foo.h */
#ifndef FOO_H
#define FOO_H
typedef struct foo foo_t;
#endif
/* foo.c */
#include "foo.h"
struct foo {
int x;
int y;
};
...
Or it is necessary to make forward structure declaration, as in:
/* foo.h */
struct foo;
typedef struct foo foo_t;
while 'foo.c' defines the structure members and the like. What's the big difference with these? They compile perfectly well.
Thanks in advance.
--
Mark