You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Are the questions really heavy/incorrect?
For a long time I used the first way ("by reference"), but I really like the idea of descriptors. I just don't know if it's worth rewriting all the classes for.
The first method will work faster. Access via the 'descriptor' takes longer.
A clue,
If a parent class has 15 methods, but the child class has one method of its own and uses only three methods inherited from the parent class, how will memory be allocated for the child class: based on the need to allocate memory for 16 methods, or based on only 4 actually used methods?
Can you give me a hint?
A clue,
If a parent class has 15 methods, but the child class has one method of its own and uses only three methods inherited from the parent class, how will memory be allocated for the child class: based on the need to allocate memory for 16 methods, or based on only 4 actually used methods?
The memory of an object is not allocated to methods, but to data. All methods (i.e. functions) are stored in a single instance in the executable code
The search doesn't work. I may be repeating myself, but the question is: can a class object destroy itself? I.e. first we get a reference of the object to itself in the class object using the reserved word this, then we apply the delete operator to the corresponding object descriptor (pointer).
Something like:
Or is it better/preferable to delete an object "externally" rather than "internally"?
........: Can a class object destroy itself? That is, we first obtain a reference to the object itself in the class object using the reserved word this, then we apply the delete operator to the corresponding object descriptor (pointer).
Suicidal tendencies are a sure sign of considering the situation in too narrow a context.)
I have a counter question: where are you going to call all this stuff from? Write a more practical example, so that you can see the thread of execution in your program. How will you address the object?
Let me explain. If the object is static (global level) or automatic (in the stack), we don't need to address it. The executing system will eliminate it automatically when it's needed.
But if the object is dynamic, it means that it has an external reference which should be zeroed when deleting.
There are no other options.
Suicidal tendencies are a sure sign of viewing the situation in too narrow a context. :)
...