Questions from a "dummy" - page 180

 
Dimka-novitsek:
Oh, thank you!!!! It's there!!!
Semyon Semenych.....('The Diamond Arm')
 

The loop is correct, such a construction is acceptable, because i is declared globally, it is initialized 0 by default.

But why do we buy by Bid? Will we sell by Ask? Apparently, the deviation is larger than the spread, otherwise it wouldn't open at all. Although, how does OrderCheck miss it?

 
Dimka-novitsek:

I have declared int i; outside of functions, above it's tick, that it would open orders exactly five! Otherwise it would open a lot of them. The main thing is that it works.

It's the first time I've heard or read it! Interesting.

Cool!!! Thanks.

Personally, I got the impression that you don't use documentation. At all.

Stop. Take a break. Read.

 
Dimka-novitsek:
What's lost? I think from the reference...
Give me a quote from the reference.
 
Apparently I didn't get enough sleep, the question doesn't make sense. Deleted the question.
 

I got a little excited above, so I'll repeat the question :) :

Is it possible to solve the following problem in C++


In the case:

Q1 *p = new Q2();

p->Fn();

Q1::Fn() will be called;

You need Q3::Fn();

I think the figure is rather informative. If not, please ask another question.

 

220Volt:

Q1::Fn() will be called;

You need Q3::Fn();

then call

Q3::Fn();

al operator :: doesn't work anymore?

 
sergeev:

So call

Q3::Fn();

al is the :: operator not working anymore?

The catch is that multiple inheritance introduces uncertainty for the compiler, we need to set inheritance priorities or do a dumb Q3 inheritance, but how. I emphasize that we have to make a virtual function in the ancestor. Referring to a function after multiple inheritance causes no problems.
 
sergeev:

So call

Q3::Fn();

al operator :: doesn't work anymore?

If you call it that way, should you rename the functions so that they have different names?

to Faku1Fn and Faku3Fn :)

Same willy-nilly, only from the side.

There will be no conflicts at all in that case.

220Volt:

I've gone too far above, so I'll duplicate the question :) :

Is it possible to solve the following task in C++


In the case

Q1 *p = new Q2();

p->Fn();

Q1::Fn() will be called;

You need Q3::Fn();

I think the figure is rather informative, if not, please ask me a follow-up question.

Define the super-problem, what it's for, and then the solution will appear.

Because right now the solution just boils down to:

class Q1

class Q3 : public Q1

class Q2 : public Q3

 
Urain:

Define the over-objective, what it's for, then a solution will emerge.

Because right now the solution simply boils down to:

class Q1

class Q3 : public Q1

class Q2 : public Q3

the interest is probably purely academic

how to do Q3 in C++ : public Q1, public Q2

and at the same time make the compiler understand what is expected of it.

Reason: