Обсуждения
why does the 'else' statement on this code only work on the 'if' statement before it. I want it to work for all the 'if' statements in the code (that is, if none of the 'if' statements is true, then the else statement should execute). If that is not possible, then how it can be done?
2 голосов
6 ответов#include <iostream>
using namespace std;
class A{
public:
void f1();
};
class B : public A{
public:
virtual void f1();
}
int main()
{
A * obj = new B;
obj.f1();
}
Ques: can we write virtual before an overridden function from the base class?? if yes which f1() should it call base class f1() or derived class f1()???
0 голосов
1 ответАктуальное сегодня
How can one build an Ai app
4 Votes
AI Takeover
2 Votes
How to learn python
1 Votes
C course progress restart
2 Votes
Using Python on VScode
0 Votes
Average of Two Numbers
0 Votes
Python Developer
0 Votes
Hearts
0 Votes