473,385 Members | 2,210 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.

Initializing base class portion of a derived class in a constructor

I have source code similar to the following:

public class Vehicle
{
protected int dataA;
// ... additional fields
}

public class FourWheelVehicle : Vehicle
{
protected float dataXYZ;
// ... additional fields

// [ constructor goes here ]
}

public class SUV : FourWheelVehicle
{
// ... additional fields

// [ constructor goes here ]
}
Nov 16 '05 #1
2 1745
WHats the question?

Try this http://www.yoda.arachsys.com/csharp/constructors.html

J.J. Feminella wrote:
I have source code similar to the following:

public class Vehicle
{
protected int dataA;
// ... additional fields
}

public class FourWheelVehicle : Vehicle
{
protected float dataXYZ;
// ... additional fields

// [ constructor goes here ]
}

public class SUV : FourWheelVehicle
{
// ... additional fields

// [ constructor goes here ]
}


--
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilipdotnet at apdiya dot com
Nov 16 '05 #2
Dilip,

Sorry. I hit the Send button before I'd finished. Please see the post above.

Best wishes,
JJ

"Dilip Krishnan" <dilipdotnet..NOSPAM..@apdiya.com> wrote in message
news:Oq**************@TK2MSFTNGP11.phx.gbl...
WHats the question?

Try this http://www.yoda.arachsys.com/csharp/constructors.html

J.J. Feminella wrote:
I have source code similar to the following:

public class Vehicle
{
protected int dataA;
// ... additional fields
}

public class FourWheelVehicle : Vehicle
{
protected float dataXYZ;
// ... additional fields

// [ constructor goes here ]
}

public class SUV : FourWheelVehicle
{
// ... additional fields

// [ constructor goes here ]
}


--
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilipdotnet at apdiya dot com

Nov 16 '05 #3

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

Similar topics

8
by: Dave | last post by:
class base { public: base(const base &other) { // Init. here... } // Stuff }; class derived: public base { public:
7
by: Douglas Peterson | last post by:
Take a look at this code, it looks funny as its written to be as short as possible: -- code -- struct Base { ~Base() { *((char*)0) = 0; } }; struct Derived : public Base
2
by: J.J. Feminella | last post by:
I have source code similar to the following: public class Vehicle { protected int dataA; // ... additional fields } public class FourWheelVehicle : Vehicle {
3
by: J.J. Feminella | last post by:
(Please disregard the previous message; I accidentally sent it before it was completed.) I have source code similar to the following. public class Vehicle { protected string dataV; // ......
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.