Passing object in c++ in a constructor

Правка en2, от Sumanto, 2020-09-10 08:46:08

My earlier code which was giving error: complete implementation here: https://ideone.com/MuOmlS

Code giving compilation error

This Code giving error as:

ERRORS

correct code after referring this thread https://stackoverflow.com/questions/12466055/field-has-incomplete-type-error/12466219 i implemented and it worked but from this thread i couldn't able to understand why pointer object is doing which leads to removal of error? complete implementation here: https://ideone.com/SSVnOU

Correct code ( doubt is don't know why working correctly)

UPDATE: After referring some blogs i came to know there is also an another way of handling this case

Different implemetation (correct)

I Believe i am missing some concept of c++ language which i need to know to understand what's going on here. Please share your views regarding this.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский Sumanto 2020-09-10 08:53:08 21
en2 Английский Sumanto 2020-09-10 08:46:08 704
en1 Английский Sumanto 2020-09-10 08:03:27 1719 Initial revision (published)