Unreferenced variable
An unreferenced variable in the source code of a computer program is a variable that is defined but which is never used.[src] This may result in a harmless waste of memory.[src] Many compilers detect such variables and do not allocate storage for them (i.e., "optimize away" their storage), generally also issuing a warning as they do.[src] Some coding guideline documents consider an unreferenced variable to be a symptom of a potential coding fault.[src] On the other hand, unreferenced variables can be used as temporary placeholders to indicate further expected future developments in the code.[src]
An unreferenced variable in the source code of a computer program is a variable that is defined but which is never used.[src] This may result in a harmless waste of memory.[src] Many compilers detect such variables and do not allocate storage for them (i.e., "optimize away" their storage), generally also issuing a warning as they do.[src] Some coding guideline documents consider an unreferenced variable to be a symptom of a potential coding fault.[src] On the other hand, unreferenced variables can be used as temporary placeholders to indicate further expected future developments in the code.[src] ==Examples== C: int main(void) { int i, j; for (i=0; i In this example, j is an unreferenced variable.[src]
11 sentences · 11 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Unreferenced variable." encyclopegia.org, 2023, https://encyclopegia.org/wiki/unreferenced-variable. Accessed 29 November 2026.
Chicago
"Unreferenced variable." encyclopegia.org. Accessed November 29, 2026. https://encyclopegia.org/wiki/unreferenced-variable.
APA
encyclopegia.org. (2023). Unreferenced variable. Retrieved November 29, 2026, from https://encyclopegia.org/wiki/unreferenced-variable
Accessed November 29, 2026 · CC BY-SA 4.0 · citation page · JSON