### Question 16.8

What do ``Segmentation violation'' and ``Bus error'' mean?

These generally mean that your program tried to access memory it shouldn't have, invariably as a result of improper pointer use. Likely causes are inadvertent use of null pointers (see also questions 5.2 and 5.20) or uninitialized, misaligned, or otherwise improperly allocated pointers (see questions 7.1 and 7.2); corruption of the `malloc` arena (see question 7.19); and mismatched function arguments, especially involving pointers; two possibilities are `scanf` (see question 12.12) and `fprintf` (make sure it receives its first `FILE *` argument).

See also questions 16.3 and 16.4.

Read sequentially: prev next up top

This page by Steve Summit // Copyright 1995 // mail feedback