Jump to content

Unreferenced variable

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Martinwguy (talk | contribs) at 21:58, 27 February 2007 (Create article). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

An unreferenced variable in a computer program is a variable that is declared but which is never used. This usually results in a harmless waste of memory and may provoke a warning from the language's compiler or runtime system.

Examples

C:

int main() {
  int i, j;
  for (i=0; i<10; i++) printf("%d", i);
  return 0;
}

In this, {{{j}}} is an unreferenced variable.