Jens Gustedt's Blog

December 27, 2010

constant expressions

Filed under: C99, integers, language — Jens Gustedt @ 09:25

In C, constant expressions come in two different flavors:

  1. integer constant expressions
  2. initializer constant expressions.

The naming of (1.) is (again!) sort of unfortunate, because as we will see below there are constant expressions of integer type that are not integer constant expressions in the sense of the C standard. Better think of (1.) of as compile time constant integer expressions.


December 12, 2010

assignment and initialization

Filed under: C99, language, P99, syntax — Jens Gustedt @ 04:45

The innocent like character = has two different meanings in C, assignment and initialization. Unfortunately this difference is somehow not very pronounced and leads to confusion and inappropriate use. Many hard to track bugs are caused by lack of proper initialization.

Create a free website or blog at