October 2004
Intermediate to advanced
336 pages
6h 27m
English
An easy and common mistake is using the wrong variable name. For example, the author meant to write
i = 5;
but instead wrote
j = 5;
In many languages, this generates an error unless j is defined and is the same type as i, but the existence of two variables of the same type and similar names can be the cause of the B.variable error (because the programmer is thinking about both variables), so this is more common than you might expect. Often, when first typing in code, there will be typos. For example, your finger might slip off the I key and hit the adjacent key to wind up with:
io = 5;
Whether this is caught quickly might depend on how the language specifies that undeclared variables should be treated.
One source of ...
Read now
Unlock full access