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
This is a discussion on Initialization and assignment within the C++ Programming forums, part of the General Programming Boards category; Hi, I am very much confused with the two things i.e. Initialization and assignment. Can anyone please explain me what ...
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.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
suppose I say
int a;
a=123;
then how can we realize this is initialization or assignment
Thanks
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
so if we say
int a=123; then it should be initialization
am I correct
Yes.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
No, rajesh1978's example in post #5 is that of copy initialisation, not "initialisation and assignment", while your example is that of direct initialisation.Originally Posted by Elkvis
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way