pure-virtual Questions
8
Solved
I'm learning about C++ in a class right now and I don't quite grok pure virtual functions. I understand that they are later outlined in a derived class, but why would you want to declare it as equa...
Rheum asked 1/7, 2009 at 20:7
6
Solved
In C++, it is legal to give an implementation of a pure virtual function:
class C
{
public:
virtual int f() = 0;
};
int C::f()
{
return 0;
}
Why would you ever want to do this?
Related ques...
Roxi asked 10/6, 2009 at 19:1
6
Solved
Just wondering, because of a problem I am running into, is it possible to create a vector of pointers? And if so, how? Specifically concerning using iterators and .begin() with it, ie: How would I ...
Clouet asked 3/5, 2009 at 14:59
2
Solved
Is it wrong to write:
class A {
public:
virtual ~A() = 0;
};
for an abstract base class?
At least that compiles in MSVC... Will it crash at run time?
Dragelin asked 10/3, 2009 at 16:2
2
Solved
Here's the deal. I have a big class hierarchy and I have this one method that is extended all the way through. The method always has to look at one or two more variable at each new level and these ...
Renault asked 7/12, 2008 at 23:32
7
Solved
Let's say we have a concrete class Apple. (Apple objects can be instantiated.)
Now, someone comes and derives an abstract class Peach from Apple. It's abstract because it introduces a new pure virt...
Hastate asked 21/11, 2008 at 22:20
© 2022 - 2024 — McMap. All rights reserved.