Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!gatech!psuvax1!psuvm!brl102 From: BRL102@psuvm.psu.edu (Ben Liblit) Newsgroups: comp.lang.c Subject: initializing to expressions Message-ID: <91039.144030BRL102@psuvm.psu.edu> Date: 8 Feb 91 19:40:30 GMT Organization: Penn State University Lines: 18 I want to initialize an array with values that are constant, but are in the form of expressions. For example, double value[ 2 ] = { sqrt( 2 ) / 2, cos ( sqrt( 5 ) ) }; Is there any way to accomplish this? I know I could do this in some sort of 'for' loop, or else by assigning values explicitly. I'd really like to avoid this, though, as having the initialization in the declaration area would be much more readable. The example above is a simplification -- the actual arrays are quite large and explicit, individual assignment would be too cluttering. Is there *any* way to convince my compiler (High C Compiler version 2, off of a Unix box) to give me this sort of initialization within the declaration area? Ben Liblit BRL102 @ psuvm.psu.edu -- BRL102 @ psuvm.bitnet Liblit @ endor.cs.psu.edu "Fais que tes reves soient plus longs que la nuit."