Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!bellcore!faline!ulysses!hector!jss From: jss@hector.UUCP (Jerry Schwarz) Newsgroups: comp.lang.c Subject: Re: interesting type problem Message-ID: <2993@ulysses.homer.nj.att.com> Date: Mon, 21-Sep-87 17:08:47 EDT Article-I.D.: ulysses.2993 Posted: Mon Sep 21 17:08:47 1987 Date-Received: Wed, 23-Sep-87 01:28:27 EDT References: <8626@utzoo.UUCP> Sender: daemon@ulysses.homer.nj.att.com Reply-To: jss@hector (Jerry Schwarz) Organization: AT&T Bell Labs, Murray Hill Lines: 23 In article <8626@utzoo.UUCP> henry@utzoo.UUCP (Henry Spencer) writes: >We decide on a fairly >quick approach: we use the current character to index into a table, >which contains pointers to the appropriate next table for each character. >When we hit a NULL pointer, we're done. We will have some cyclic structures >for tokens like identifiers that can be of unlimited length. > >Question: what is the type of one of those pointers? Declare struct ptr { struct ptr *p ; } ; And let your values be "struct ptr*". You won't need any casts (just selections) and on most machines with multiple formats for pointers, the efficient one will be used for pointers to structures. Jerry Schwarz Bell Labs, Murray Hill