Jump to content

Talk:Declaration (computer programming)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by A.A.Graff (talk | contribs) at 04:03, 21 May 2010 (Merge suggestion: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

WikiProject iconComputing Start‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.
WikiProject iconComputer science Start‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.
Things you can help WikiProject Computer science with:

The code examples are interchanged, aren't they?

—– 195.14.207.180 11:05, 18 August 2006 (UTC)[reply]

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)[reply]

initialization

Initialization = definition? --Abdull (talk) 19:53, 21 December 2007 (UTC)[reply]

No. For variables, reserving memory = definition, initialization = initialization. The article is misleading. 81.131.65.15 (talk) 12:18, 5 April 2010 (UTC)[reply]

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. 81.131.65.15 (talk) 12:13, 5 April 2010 (UTC)[reply]

Merge suggestion

See Talk:Initialization_(programming)#Merge suggestion. A.A.Graff (talk) 04:03, 21 May 2010 (UTC)[reply]