Turbo C large character array

Stephen Clamage steve at taumet.com
Fri Aug 3 01:03:44 AEST 1990


donp at na.excelan.com (don provan) writes:

>In general, i avoid sizeof(type), since
>there's almost always a specific example of type at hand, and normally
>it is in fact that specific example i want to know the size of, not
>the generic type.

In general, I agree, but there is one pitfall with this:

typedef int datatype[20];

int foo(datatype d)
{
    ... sizeof(d) ...
}

The type of d is silently coerced to int*, and sizeof(d) becomes
sizeof(int*), which is not what you want.
-- 

Steve Clamage, TauMetric Corp, steve at taumet.com



More information about the Comp.lang.c mailing list