C strongly typed?

Mike Haertel mike at cs.umn.edu
Sat Mar 10 14:33:59 AEST 1990


In article <862 at enea.se> sommar at enea.se (Erland Sommarskog) writes:
>Well, apparently I am allowed to mix apples and oranges. If I have
>two types of data that both happens to be represented by integers,
>but have no logical connection what so ever I cannot apparently 
>express that in C. And consequently I cannot take help from the
>compiler to catch inadvertent mixups in for instance procedure calls.

So declare

struct apple { int v; };
struct orange { int v; };

C uses name equivalence for structure types.
-- 
Mike Haertel <mike at ai.mit.edu>
"We are trying to support small memory machines." -- Larry McVoy



More information about the Comp.lang.c mailing list