473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

difference between these two struct definitions

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.

Aug 4 '06 #1
1 1136
OnlyOpenSource writes:
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.
struct A{
(...)
struct B
{
(...)
int (*fp2)(void);
} *pb;
};

and

struct B
(...)
} ;
struct A{
(...)
struct B *pb;
};
--
Hallvard
Aug 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

50
by: MozillaCensorsMe | last post by:
Hello, While I haven't finished my wonderful tutorial to save the world, I do have a simple question. What's the difference between h1 and the title tag? For me it seems as though both can...
11
by: Shea Martin | last post by:
I have been programming in C++ for over 4 years. I *think* I knew that a struct could have a constructor but I decided to dig into it a little more today, and found that there is very little...
6
by: S.Tobias | last post by:
I'm trying to understand how structure type completion works. # A structure or union type of unknown # content (as described in 6.7.2.3) is an incomplete type. It # is ...
11
by: Pradyut | last post by:
what's the difference between a .h and a .hpp file Also please tell me something about .rh files -- Pradyut http://pradyut.tk http://groups.yahoo.com/group/d_dom/...
2
by: Kevin B Ebert | last post by:
Today, I ran into something I didn't quite expect. I'm sure there is a logical explanation for it so I want to post it and see if anyone can explain the difference to me. I came across a...
5
by: Chris | last post by:
Hi, I don't get the difference between a struct and a class ! ok, I know that a struct is a value type, the other a reference type, I understand the technical differences between both, but...
5
by: alcool | last post by:
hi, I have 2 date/time values i.e. the system date/time and (h:m dd:mm:yyyy). I would like know to find a routine that calculate this difference. Maybe using the struct time_t and difftime. ...
10
by: Ahmad Humayun | last post by:
Whats the difference between: char str1 = "wxyz"; char* str2 = "abcd"; I can do this: str2 = str1 but I can't do this: str1 = str2
7
by: remlostime | last post by:
I have written a SplayTree class, what makes me wonder is when I compiled it, it has something errors: error:'SplayNode' has not been declared you can see the code below that the SplayNode has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.