difference between these two struct definitions

O

oo@@oo

Hello

What is the difference between these two struct definitions ?

-------------------------header.h
---------------------------------------
struct A{
int a;
int b;
struct B
{
int (*fp1)(void);
int (*fp2)(void);
} *pb;
};

and

------------------------- another header.h
---------------------------------------
struct B
{
int (*fp1)(void);
int (*fp2)(void);
} ;

struct A{
int a;
int b;
struct B *pb;
};

Thank you in advance.
 
H

Hallvard B Furuseth

OnlyOpenSource said:
What is the difference between these two struct definitions ?

In C, nothing. In C++, the inner struct gets the name A::B in
one case and B in the other.
 

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
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top