devxlogo

March 28, 2000

Recursion in the Real World

Computer science sophomores learn that recursion can neatly solve complex problems, e.g., Hanoi rings, wildcard handling, and parsing. In practice, however, recursion can be problematic for several reasons. First of

Avoid Assignments Inside an If Condition

An assignment expression can appear inside an if condition: if (x = getval() ) { // do someting } The if condition is evaluated in two steps: first, the unconditional

The Linkage Type of Typedef Names

By default, a typedef name declared in the global scope has internal linkage. This means that separately compiled source files can’t refer to a typedef declared in another source file,