Linked Questions

0 votes
2 answers
75 views

I am enrolled in a C++ course, where i have the following code snippet: class Pet { protected: string name; public: Pet(string n) { name = n; } void run() { ...
taurus05's user avatar
  • 2,574
0 votes
1 answer
147 views

I am implementing an AVLTree in C++ as an exercise as preparation for future projects. An AVLTree is basically a BSTTree but with the extra detail that the tree is balanced, i.e., for a node x with ...
Kevin de Vos's user avatar
1 vote
2 answers
114 views

I know its a weird question but I was asked this in an interview by the CEO of a software house, First, he asked if a remote could be considered an Object, If yes then explain why? If it is an object ...
Bani Akram's user avatar
0 votes
1 answer
224 views

I am making a simple 2D physics engine for circles and squares. I have a body class that I want to be given a unique_ptr instance of a shape when created. The shape can either be a circle or a box. ...
bboan's user avatar
  • 1
-1 votes
1 answer
110 views

I'm trying to create a performance monitor of sorts to run on a Particle board (STM32 based). I'm used to programming in c so the OOP approach is a bit new but I think it would fit well here. For the ...
spizzak's user avatar
  • 1,167
3 votes
1 answer
128 views

Since static functions belong to a class, they are inherited but not overridden, merely hidden. From the code below, it seems that the woof method in B can only have a "throws IOException" declaration ...
welcomedungeon's user avatar
1 vote
1 answer
94 views

Note: See the update below, as I altered the original concept, based on the first answer+comment I'm sorry if this is a trivial question or if it solely depends on the programmers preference. As I am ...
Nicolas's user avatar
  • 828
0 votes
1 answer
102 views

so I have this code: Base* objbase = new Derived(); //perform a downcast at runtime with dynamic_cast Derived* objDer = dynamic_cast<Derived*>(objBase); if(objDer)//check for success of the ...
Alex's user avatar
  • 886
2 votes
2 answers
72 views

Why my code does two instances, one for the parent class and one for the child class. I figure the code in the main() ask for only one. I try to unsterstand why that's happen, but no idea coming to my ...
Knupel's user avatar
  • 373
0 votes
1 answer
115 views

With c++, I am trying to create a class called "family". Family is parent class of child class "man," and I'm trying to create an array of "man" in family class, but in order to do that, I need to ...
Hellowhatsup's user avatar
-1 votes
1 answer
142 views

I would like to now if the following is possible. I have a templated class called A which inherits from a class called Base. In Base I set a write() function to be rewritten for every derived class. I ...
user avatar
0 votes
0 answers
142 views

I'm practicing a prototype program for a text-based game with complex character features. I have simplified much of what I already wrote, but I'm new to programming and have run into a problem. I ...
ClayDav's user avatar
0 votes
3 answers
109 views

Currently I have admin class, user class and lecturer class. Then I want user and lecturer inherit from user. But the problem is my user class constructor is about the username, password, but the ...
user avatar
-5 votes
1 answer
68 views

Say I have an interface defined as: class MyInterface : public virtual ObjectInterface { public: virtual bool MyFunc() = 0; }; Then I have a class which adopts this interface, in the header file:...
Clip's user avatar
  • 3,068
1 vote
2 answers
70 views

and sorry for the weird title. There is my class hierarchy : TimedObject SpeedModifer ImediateSpeedModifier LinearSeedModifier .. More classes .. .. More classes .. In the files, all TimedObject's ...
Nils 'Linkpy' Reid's user avatar

15 30 50 per page