Desperado wrote:
Does anybody disagree ? (Hope not)
I agree
Thanks everybody for the clarification
Marco
Moderator: Ras
Desperado wrote:
Does anybody disagree ? (Hope not)
You are right, a definition also serves as a declaration, if there hasn't been one earlier. The name is introduced AND its meaning is defined at once.Desperado wrote:Funny (a little bit) the thread here.
We are back to the roots
But talking about such basics i would like to add my statement once
again:
For me:
- a Declaration (doesnt matter c / c++ elsewhere) just
lets the compiler know that there is existing something(a type,class whatever).if this content is given it is a declaration. Sometimes it is two in one a Declaration and the next, a Definition.
- a Definition for me is when you let the compiler know how the type/class
looks like.(so this can(must not) be done with a declaration).
- and then of course the instances... (without comment)
So, for me doesnt exist a so called "Forward Declaration". The only thing
to differ if declartion and definition is a "2 in 1 statement" or both of them are seperate instructions (if you want to call this "seperate" -> "Forward Declaration" thats ok, but doesnt change the contents, and because it doesnt change the contents you can simple call it "declaration").
(Also the word declaration (in my eyes) cant be done twice. if it declared it's declared, or not ?)
Does anybody disagree ? (Hope not)