Question: Here is a code snippet illustrating my question:

```
const float D    = 0.1F;
const float A[4] = {sin(0*D), sin(1*D), sin(2*D), sin(3*D)};

```

Imagine that global array `A` is much longer and you don't want to do all of this repetitive typing. Is there a shorter way to initialize array A at compile or initialization time, i.e. without having to write initialization function and call it somewhere in my program?

Answer: 
You could initialize A during dynamic initialization time as follows:

```
const float *init_a(float x_)
{
  static float data[4];
  for(unsigned i=0; i<4; ++i)
    data[i]=sin(i*x_);
  return data;
}

const float D=0.1f;
const float *A=init_a(D);

```
In case you `A` array will always stays the same and is very big, you can always write a short script, which calculates every value in array and output could be used in source code to have static initialization.

In case formula is simple, even MS Excel could be used to *generate* that kind of static initialization data.