|
by: Teis Draiby |
last post by:
I want to write a base class that includes a member function that creates an
instance of a derrived class and returns a pointer to it.
Problem: The derived class definition has to follow the base class
definition. Therefore I can't specify the return type of the function, that
returns a pointer to the derived class, because the derived class...
|
by: Shao Zhang |
last post by:
Hi,
I am not sure if the virtual keyword for the derived classes are
required given
that the base class already declares it virtual.
class A
{
public:
virtual ~A();
|
by: Stephan Hoffmann |
last post by:
Hi,
I'm new to std::auto_ptr<> and wanted to use it with
a base class and several derived classes.
I'm using gcc 3.3.5 and get a compile error I don't know
how to resolve when compiling the following (in file testInteger.cc):
line 38: std::auto_ptr<HInteger> d(new HInteger(5));
line 39: std::auto_ptr<HObject> e(new HObject());
|
by: campos |
last post by:
"Effective C++ 3rd Edition" Item 6, P39
-------------------------------------------------------
class Uncopyable {
protected: // allow construction
Uncopyable() {} // and destruction of
~Uncopyable() {} // derived objects...
private:
Uncopyable(const Uncopyable&); // ...but prevent copying
|
by: Bushido Hacks |
last post by:
I think this message got lost the first time I sent it, so I'm
reposting it.
I need a little help with Destructors.
Suppose I created a multidimmensional array in a Base class that was
also accessable in a Derived class, would I need to delete the array
in the Derived class if I declared my destructors as virtual?
class Base
{
public:
|
|
by: developereo |
last post by:
Hi folks,
Can anybody shed some light on this problem?
class Interface {
public:
Interface() { ...}
virtual ~Interface() { ...}
virtual method() = 0;
};
|
by: mweltin |
last post by:
I have a derived class that extends a base class by adding a float
member. The strange part is when I use the STL sort algorithm on a
vector of derived classes, only hte float member is sorted.
For example assume a vector containg three derived class objects
called blah.
blah { ... int one = 7 , int two = 5, int three =8 , float five =
1}...
|
by: =?Utf-8?B?R2Vvcmdl?= |
last post by:
Hello everyone,
I met with a strange issue that derived class function can not access base
class's protected member. Do you know why?
Here is the error message and code.
error C2248: 'base::~base' : cannot access protected member declared in
|
by: Bhawna |
last post by:
I am into c++ code maintenance for last 3-4 years but recently I am
put into design phase of a new project. Being a small comapany I dont
have enough guidance from seniors.
Currently I am into a situation where I am implementing base class
functions by including a pointer to subclass member in base class.
Reason being functionality is...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
|