What is the difference between definition, declaration and initialization?
I will answer this question in a general and complete way and not with respect to any programming language There is a hell of a lot of confusion between declaration, definition, and initialization. Sometimes they all look similar and sometimes completely different. Before understanding the differences, It is very important to be aware of two things: The difference between declaration, definition, and initialization varies from one programming language to another. Each programming has its own way of doing these three things. The “thing” which you are defining, declaring, or initializing also affects the difference between the three of them. That “thing” can be a variable, a class, or a function. All of them have different meanings of definitions, declaration, and initialization. Once we are aware of the above two things, most of the doubts get cleared and we stop seeking exact differences because it’s not there. In general terms ( irrespective of any language or “thing”) The declaration...