Expressions in initializers

Christopher R Volpe volpe at camelback.crd.ge.com
Tue Mar 5 23:39:13 AEST 1991


In article <17294 at crdgw1.crd.ge.com>, I wrote
|>
|>"The square root of two" can be evaluated at compile time, but "sqrt(2.0)"
|>is an invocation of a function. How is the compiler supposed to know
|>what sqrt is? I could have in another file:
|>
|>double sqrt(double x)
|>{
|>  return x - 1.0;
|>}

It was pointed out to me that this is illegal.                   
==================
Chris Volpe
G.E. Corporate R&D
volpecr at crd.ge.com



More information about the Comp.lang.c mailing list