Path: utzoo!utgpu!attcan!uunet!modcomp!joe From: joe@modcomp.UUCP Newsgroups: comp.lang.c Subject: Re: problems using sizeof() Message-ID: <8000001@modcomp> Date: 19 Aug 88 15:11:00 GMT References: <751@arctic.nprdc.arpa> Lines: 24 Nf-ID: #R:arctic.nprdc.arpa:751:modcomp:8000001:000:730 Nf-From: modcomp.UUCP!joe Aug 19 11:11:00 1988 Jeff Siegal (jbs @ fenchurch.mit.edu.UUCP) writes: >In article <8553@ihlpb.ATT.COM> nevin1@ihlpb.UUCP (55528-Liber,N.J.) writes: > >[...]the more general problem of determining the size of an array which is > >passed via a pointer cannot be done in C. > >Nor in any other language, [...] You can't tell the size of an object from a >pointer to it. Not true for Fortran 77. The semantics of the language require that the size of a character string argument also be passed to a procedure. The construct which requires this feature is: SUBROUTINE FOO(CA) CHARACTER*(*) CA : END The asterisk in parens forces CA to assume the size of the calling argument on each instantiation of the procedure. Joe Korty uucp!modcomp!joe