Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!mhres!jv From: jv@mhres.mh.nl (Johan Vromans) Newsgroups: comp.lang.c Subject: Re: Does ANSI C have lengthof() ? Message-ID: <1265@mhres.mh.nl> Date: Fri, 4-Sep-87 03:17:34 EDT Article-I.D.: mhres.1265 Posted: Fri Sep 4 03:17:34 1987 Date-Received: Sat, 5-Sep-87 16:46:38 EDT References: <9154@brl-adm.ARPA> Organization: Multihouse N.V., The Netherlands Lines: 23 In article <9154@brl-adm.ARPA> neville%zodiac@ads.arpa (Neville Newman) writes: >i wholeheartedly agree - lengthof() is such an easy macro it need not be >implemented in the compiler, and typeof() is a very useful pseudo-function >to have in the compiler. I think there is more need for these functions in the pre-processor: # if sizeof (char*) == sizeof (int) typedef int numptr; # else # if sizeof (char*) == sizeof (long) typedef long numptr; # endif # endif # if unknown (typeof (numptr)) .... error .... # endif -- Johan Vromans | jv@mh.nl via European backbone Multihouse N.V., Gouda, the Netherlands | uucp: ..{?????!}mcvax!mh.nl!jv "It is better to light a candle than to curse the darkness"