Jump to content

Talk:Undefined variable

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Decltype (talk | contribs) at 12:50, 6 October 2009 (computing low-importance). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputing Stub‑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.
StubThis article has been rated as Stub-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.

The original definition given was this:

  • An undefined variable in a computer program is a variable name that is called by the program but which has not been previously assigned a value by that program.

I think that would describe an "uninitialized variable". For example,

// C
int x;
printf("%d", x);
// x is declared but uninitialized
// Java
Frame x = null;
x.show();
// x is declared but set to null

Some clarification may be needed of the terms

  • undefined variable
  • undeclared variable
  • uninitialized variable
  • NULL (C), null (Java(, nil, or undef (Perl) as in reference or pointer type.

File Not Found 04:01, 8 February 2006 (UTC)[reply]

I totally agree. "Definition" == assignment. This article describes, as its first sentence even suggests, undeclared variables. --pfunk42 11:41, 9 November 2006 (UTC)[reply]