TITLE: Dimensions and initialization of arrays PROBLEM: stefans@bauv106.informatik.unibw-muenchen.de (Stefan Schwarz) I want to use a static array within a class, and therefore i initialize it as follows: foo.h: ------ class Foo { private: static int array[2][2]; public: Foo() {}; }; foo.c: ------ int Foo::array[2][2] = { 1,2, 3,4}; Is there any way to avoid the double definition of the array-bounds, so i could easyly change the size of my array. RESPONSE: p j l @sunb4.cs.uiuc.edu (Paul Lucas), 14 Jul 92 First, for a 2d array, you need only specify the number of columns. Now then: class Foo { enum { Cols = 2 }; static in array[][Cols]; // ... public: // ... }; int Foo:array[][Cols] = { 1,2,3,4 }; To change the number of colums, just change Foo::Cols.