Hi,
I am very much confused with the two things i.e. Initialization and assignment.
Can anyone please explain me what exactly these two things
Thanks
Printable View
Hi,
I am very much confused with the two things i.e. Initialization and assignment.
Can anyone please explain me what exactly these two things
Thanks
Refer to Stroustrup's glossary:
initialization - giving an object an initial value. Initialization differs from assignment in that there is no previous value involved. Initialization is done by constructors.
suppose I say
int a;
a=123;
then how can we realize this is initialization or assignment
Thanks
so if we say
int a=123; then it should be initialization
am I correct
Yes.
No, rajesh1978's example in post #5 is that of copy initialisation, not "initialisation and assignment", while your example is that of direct initialisation.Quote:
Originally Posted by Elkvis