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.