adspace


Can I have a reference as a data member of a class? If yes, then how do I initialise it?

Answer Posted / Irshad Ahamad

Yes, you can have a reference as a data member of a class. To initialize it, you should use the initialization list in the constructor's function body instead of the member initializer list within the class declaration.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1165


What is the latest version on c++?

1209


What character terminates all character array strings a) b) . c) END

1397


daily Routine of father

1485


Can union be self referenced?

1267