Singleton variable

Singleton variable

In computer programming a singleton variable is a variable that is referred to only once after it has been declared.

Examples of where a variable might only be referenced once is as a dummy argument in a function call, or when its address is assigned to another variable which subsequently accesses its allocated storage.

This usage pattern sometimes occurs because a mistake has been made, with more than one reference being intended. Some compilers and lint-like tools flag occurrences of singleton variables.

See also

Singleton pattern

Search another word or see singleton variableon Dictionary | Thesaurus |Spanish
Copyright © 2015, LLC. All rights reserved.
  • Please Login or Sign Up to use the Recent Searches feature