473,385 Members | 1,766 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,385 software developers and data experts.

Struct and inheritance

Two questions,
1) Is it possible to use struct with inheritance especially in a C
(not C++) program ?
2) What should I do to make some member operations in struct private ?
Thanks in advance for any help
Jul 22 '05 #1
3 3763
1) no
2) private:

Vince

"HenryTseung" <ab********@yahoo.co.jp> wrote in message
news:94**************************@posting.google.c om...
Two questions,
1) Is it possible to use struct with inheritance especially in a C
(not C++) program ?
2) What should I do to make some member operations in struct private ?
Thanks in advance for any help

Jul 22 '05 #2

"HenryTseung" <ab********@yahoo.co.jp> wrote in message
news:94**************************@posting.google.c om...
Two questions,
1) Is it possible to use struct with inheritance especially in a C
(not C++) program ?
2) What should I do to make some member operations in struct private ?
Thanks in advance for any help


Shouldn't you ask in the comp.lang.c newsgroup, if what you want is an
answer about C???

-Howard
Jul 22 '05 #3
On 28 Jun 2004 02:22:18 -0700, ab********@yahoo.co.jp (HenryTseung)
wrote:
Two questions,
1) Is it possible to use struct with inheritance especially in a C
(not C++) program ?
There is no inheritance in C.
2) What should I do to make some member operations in struct private ?
Thanks in advance for any help


In C or C++?

(For C questions, please post at comp.lang.c and NOT to
comp.lang.c++.)

--
Bob Hairgrove
No**********@Home.com
Jul 22 '05 #4

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

Similar topics

3
by: Cgacc20 | last post by:
I have a c struct from old code that cannot be modified and I am trying to write a wrapper C++ class around it. This class is often passed as a pointer to some c functions of a library and I...
22
by: Marcin Vorbrodt | last post by:
Taken out of C++ In a Nutshell book... Example 7-18: Using an abstract classes as interface specification. struct Runnable { virtual void run() = 0; }; struct Hashable { virtual size_t...
8
by: slurper | last post by:
hi, i'm studying some stl. i saw the pair implementation in a header-file but what i wonder is if a struct can have constructors as it seems in following snippet from the stl library. the...
15
by: Steven T. Hatton | last post by:
The following may strike many of you as just plain silly, but it represents the kind of delelima I find myself in when trying to make a design decision. This really is a toy project written for...
5
by: Martin Jørgensen | last post by:
Hi, Consider this code: --- beginning of code --- #include <iostream> using namespace std; class Child{ public:
46
by: clintonG | last post by:
Documentation tells me how but not when, why or where... <%= Clinton Gallagher http://msdn2.microsoft.com/en-us/library/saxz13w4(VS.80).aspx
9
by: werasm | last post by:
Hi all, What is the difference between: typedef struct { ... } MyS1; ....and...
12
by: not_a_commie | last post by:
What's the technical reason for not allowing structs to be hierarchical? WPF has a nice Point3D struct. I wanted to add some additional constructors to it for converting from my data types.
1
by: johnsonlau | last post by:
When a class derives from a class, You can use a pointer to the parent class to delete the instance of child only when a virtual destructor declared in the parent. class Parent { virtual...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.