Are casts constants?

Bjorn Engsig bengsig at orcenl.uucp
Tue Feb 14 20:10:30 AEST 1989


Is it allowed to have type casts in constant expressions, and if not, why?

The example

char array [ (size_t) ( ... ) ]

show, what I would like to do.  The  ...  is a constant expression,
typically including sizeof's and possibly other casts to scalars.
-- 
Bjorn Engsig, ORACLE Europe         \ /    "Hofstadter's Law:  It always takes
EUnet path: mcvax!orcenl!bengsig     X      longer than you expect, even if you
USA domain: bengsig at oracle.com      / \     take into account Hofstadter's Law"



More information about the Comp.lang.c mailing list