Unreferenced variable: Difference between revisions

Content deleted Content added
Examples: Fix formatting
Some reworking
Line 1:
An '''unreferenced variable''' in the [[source code]] of a [[computer program]] is a [[variable]] that is declareddefined but which is never used. This usuallymay resultsresult in a harmless waste of memory (unless the [[compiler]] used detects the situation and maydoes not allocate for the variable, perhaps provokeissuing a warning). from theSome language's[[coding compilerstyle|coding orguideline]] documents consider an unreferenced variable to be a potential symptom of a runtimecoding systemfault.
 
== Examples ==
Line 5:
[[C (programming language)|C]]:
<code>
int main(void) {
{
int i, j;
for (i=0; i<10; i++)
printf("%d", i);
return 0;
}