Referencing/forward declarations

  • Thread starter Christopher Benson-Manica
  • Start date
C

Christopher Benson-Manica

Are these terms semantically identical? If so, which is to be
preferred when speaking of the construct they describe?
 
J

Jack Klein

Are these terms semantically identical? If so, which is to be
preferred when speaking of the construct they describe?

What exactly is referencing? I know what a forward declaration is.
 
E

E. Robert Tisdale

Christopher said:
Are these terms semantically identical?
If so, which is to be preferred
when speaking of the construct they describe?

struct A; // forward declaration

struct B { // definition of type struct B
struct A *p; // *p is a reference
// to an object of type struct A
};

struct A { // definition of type struct A
int I;
struct B *p; // *p is a reference
// to an object of type struct B
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,140
Messages
2,570,810
Members
47,357
Latest member
sitele8746

Latest Threads

Top