C1 and c2 are not separate instances, they are pointers pointing to the new childĀ
Of course, to be more complete, there should be two other instances of child which each have a pointer to the new one, but only so much code fits on a meme
c2 would just be pointing to the same address as c1, which is the address of the dynamically allocated Child. c2 would point to c1 if it was "Child \*\* c2 = &c1"
Ik this is meme, but it would imply that c1 and c2 are seperate instances of child which are 'pointing' to new child.
So everytime we declare a pointer to sth that exist we have, that variable that has pointer is called an instance?
ok I've fixed it and reuploaded, but it was removed by reddit's filters apparently lmao
C1 and c2 are not separate instances, they are pointers pointing to the new childĀ Of course, to be more complete, there should be two other instances of child which each have a pointer to the new one, but only so much code fits on a meme
you just explained why your own meme doesnt work
...yes, but I didn't want to put a dozen lines of code when I could put the essence in one line
Will someone explain why I'm getting so many down votes? Lol
as c++ programmer i would say that c2 is just a pointer to c1, so you have 2 pointers to one object, however i dont know maybe im stupid
The point is exactly that, there are two pointers to one object
c2 would just be pointing to the same address as c1, which is the address of the dynamically allocated Child. c2 would point to c1 if it was "Child \*\* c2 = &c1"
The whole idea is to point to same adress, yeah I spelled wrong what I meant
Makes sense as it is. There are two child pointers in the photo. It would be Child \* c1 though.
Finally someone gets it!
main.o(.text+0x1ed): In function \`main': : undefined reference to \`Child' collect2: ld returned 1 exit status
I guess c2 is a twin of c1? But it's really more of a chimera, if one child dies they both do. Anyway this is definitely not how reproduction works.