Unreferenced variable
An unreferenced variable in the source code of a computer program is a variable that is defined but which is never used. This may result in a harmless waste of memory. 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. Some coding guideline documents consider an unreferenced variable to be a symptom of a potential coding fault. On the other hand, unreferenced variables can be used as temporary placeholders to indicate further expected future developments in the code. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
An unreferenced variable in the source code of a computer program is a variable that is defined but which is never used. This may result in a harmless waste of memory. 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. Some coding guideline documents consider an unreferenced variable to be a symptom of a potential coding fault. On the other hand, unreferenced variables can be used as temporary placeholders to indicate further expected future developments in the code. ==Examples== C: int main(void) { int i, j; for (i=0; i In this example, j is an unreferenced variable.
Cite this
"Unreferenced variable". 1677090747. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1140983443 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy