Anonymous
BTW what is CRTP?
Anonymous
Nikal bhosdk pehli fursat mein
Anonymous
Anonymous
Anonymous
Nikal BC pehli fursat mein
Dmitry
Its broken
klimi
is that english
Anonymous
Anonymous
Yup chutiye
Anonymous
He is sending a video lol
Anonymous
If we use a base class pointer to point to the base class object and call a virtual function using it.
Then it would be late binding. But, will that be a run time polymorphism
olli
Anonymous
Now I know what it means
Anonymous
Anonymous
Anonymous
So, what are the necessay conditions for run-time polymorphism
Anonymous
1. Inheritance
2. virtual functions in base class
and what else?
Anonymous
Implementation of virtual functions in derived classes
Anonymous
1. Inheritance
2. virtual functions in base class
3. Overriding of the virtual function
and anying else? I think using the base class pointer to point to its own object and its derived object also counts.
Anonymous
* I think using the base class pointer to point to its own object OR its derived object also counts.
Anonymous
Anonymous
So, can you provide an example with the top 3 holding true and not he last point that I mentioned.
Anonymous
isn't there any other usage
Anonymous
goin' to sleep.
Anonymous
Whenever we have
base *b = new Derived();
then if we call any non-virtual function as b->fun(), then at compile time it will run the fun() of base class due to Early Binding.
If we make fun() as virtual then it will run the child class fun() due to RUN-time poly.
Same is the case with destructor as well.
So, we need to make destructor is virtual so that first the child class destructor is executed first.
Is it completely correct Or do I need to add more.
KINDLY REPLY!!
Anonymous
I think it's ok
Abhishek
/notes
Anonymous
/get best-book
Anonymous
/get great
Anonymous
/get
Dede
Ader
hi
Vladimir
hi
http://www.nohello.com/
Anonymous
#include<stdio.h>
typedef struct demo{
int i;
float f;
char c;
}demo;
void main()
{
demo d;
printf("%d",sizeof(d));
}
Output is 12
Anonymous
#include<stdio.h>
typedef struct demo{
int i;
float f;
char c[8];
}demo;
void main()
{
demo d;
printf("%d",sizeof(d));
}
Output is 16
Anonymous
Why there is 12 output instead of 9
Kakashi Hatake
How the additional bytes get added
Kakashi Hatake
Is there any relations to all??
olli
Depends on your architecture and compiler settings. In many cases it's padded according to the biggest but at most to pointer size
Anonymous
Anonymous
Does late binding occur when virtual function of derived class is called by object of derived class?
Can we call it Run-time polymorphism too?
Nani
/saved
Anonymous
https://imgflip.com/i/36jmq7
Anonymous
Can you help me to learn C programming and data structures first to last ? please
Anonymous
Anyone!
Anonymous
That q is like finding mode in table
MᏫᎻᎯᎷᎷᎬᎠ
I'm little bit worried about the pain of reorganizing the existing projects after C++20
Anonymous
Hi
klimi
YVEF
HI
YVEF
MᏫᎻᎯᎷᎷᎬᎠ
Why?
Inclusion mechanism on codes takes too long to compile.
And modules(C++20 features) do not.
And there are like millions of software written in C++ and every one of them consist of (at least) thousand of lines.
Devs have to rewrite their projects(and the legacy ones) to adapt modules, which takes too long.
Or they have to stick with the painful long compilation time that is caused by the #include mechanism
MᏫᎻᎯᎷᎷᎬᎠ
It's a hard choice, I think
Anonymous
Where I can learn Python?
klimi
Anonymous
Thanks. I have a good knowledge about c but don't know what is a python.
Anonymous
Anonymous
Anonymous
If I have a C function taking a pointer to a struct, can I supply a C++ struct to it? (Since they are different, I don't know). Thanks in advance.
Mat
Pavel
Because if it's not pod type, it can have some customized behavior that couldn't be expected in that C function (some custom copy constructor, can have pointer to the virtual table, etc.), and C function can just memcpy the struct or somehow manipulate its memory.
Anonymous
Anonymous
Any one pls solve f
Anonymous
Guys any one pls
Anonymous
Anonymous
Hello group
︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎︎
Hello
klimi
Onkar
#best-book
Onkar
#cppbook
Dzung
Hi there, anyone knows what's the most effective way to check undefined behavior?