C strongly typed?
Brett J. Vickers
bvickers at ics.uci.edu
Fri Mar 9 09:20:23 AEST 1990
ftw at quasar.westford.ccur.com (Farrell Woods) writes:
>>In article <1990Mar7.182230.5517 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>>> C's type system is not extensible unless
>>>you count "struct", but the language is strongly typed -- mixing random
>>>types is not allowed.
>
>Henry's right! The point is that `char' and `int' (and, `short' and `long')
>all describe *integer* quantities. It's just that the range os values which
>each of these "types" can hold differs due to the amount of storage allocated
>to a variable of a given type.
If C were as strongly typed a language as Ada is, it would require that
a cast (or conversion) be used before setting two different "types" of integers
equal. If C were as strongly typed a language as Ada (or Pascal) is, it
would not allow integers to be accessed and stored as char types.
I'm not knocking this flexible typing; I find it extremely useful.
--
bvickers at bonnie.ics.uci.edu
More information about the Comp.lang.c
mailing list