Need some help with a couple of questions. Previously I have seen this
declaration;
struct Student
{
int age;
char name[50];
};
and this definition of an object;
struct Student stud;
However, what does this mean?
struct AnotherStudent;
Another question, how does forward declaration really work? Say I have
these two structs and a function pointer. This wont compile as is. How
can I fix this ?
// File ObjectA.h
typedef struct
{
ObjectB b;
} ObjectA;
// File ObjectB.h
typedef struct
{
func f;
} ObjectB;
int (*func)
(
ObjectA
);
declaration;
struct Student
{
int age;
char name[50];
};
and this definition of an object;
struct Student stud;
However, what does this mean?
struct AnotherStudent;
Another question, how does forward declaration really work? Say I have
these two structs and a function pointer. This wont compile as is. How
can I fix this ?
// File ObjectA.h
typedef struct
{
ObjectB b;
} ObjectA;
// File ObjectB.h
typedef struct
{
func f;
} ObjectB;
int (*func)
(
ObjectA
);
Comment