Talk:Declaration (computer programming)
|WikiProject Computing||(Rated Start-class, Mid-importance)|
|WikiProject Computer science||(Rated Start-class, Mid-importance)|
The code examples are interchanged, aren't they?
—– 188.8.131.52 11:05, 18 August 2006 (UTC)
Yes. I'll change them. Hopefully my change won't be regarded as vandalism (like the last attemt to change it was, back on 11 May). --Rhebus 11:52, 18 August 2006 (UTC)
Declarations don't necessarily reserve memory, and if they do, they are definitions
"For variables, definitions assign values to an area of memory that was reserved during the declaration phase." That's not correct. From The C Programming Language, Appendix 8:
Declarations specify the interpretation given to each identifier; they do not necessarily reserve storage associated with the identifier. Declarations that reserve storage are called definitions.
Definitions in C (such as int x = 7; at the top of a function) are also declarations, but a (pure) declaration is not a definition and reserves no memory. "extern char example1;" won't reserve any memory. 184.108.40.206 (talk) 12:13, 5 April 2010 (UTC)
Contradiction pertaining to definition of "Definition"
The definition of "definition" given is "definitions (declarations which provide the actual implementation in the case of functions, and initialization in the case of variables)", which is contradicted by the line below: Here are some examples of definitions, again in C: char example1; —Preceding unsigned comment added by 220.127.116.11 (talk) 13:49, 16 March 2011 (UTC)
I concur with the opinion above: the definition of "definition" is incorrect. See eg. "C++ FAQ Lite", Section [10.13] "Can I add = initializer; to the declaration of a class-scope static const data member?" 18.104.22.168 (talk) 15:20, 25 August 2011 (UTC)
See Talk:Initialization_(programming)#Merge suggestion. A.A.Graff (talk) 04:03, 21 May 2010 (UTC)