This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: static initialization of an array


On Wed, Mar 03, 1999 at 04:53:42PM +0100, Massimiliano Cialdi wrote:
> I use gcc 3.0.3
> I must initialize a fixed size (but a priori unknow) array.
> In assembler there is DUP which let to initialize a memory area with 
> some value.
> There is something similar in C?

Not in ISO C, GCC has an extension where you can initialize a range:
#define SIZE 256
int foo [SIZE] = { [ 1 ... SIZE - 32 ] = 52, [ SIZE - 1 ] = 74 };
See gcc documentation.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]