I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.
I could swear I
Back in the day (and I'm not saying it's a good idea), we'd set the first element and then:
memcpy (&element [1], &element [0], sizeof (element)-sizeof (element [0]);
Not even sure it would work any more (that would depend on the implementation of memcpy) but it works by repeatedly copying the initial element to the next - even works for arrays of structures.