Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!mandrill!chet From: chet@mandrill.UUCP Newsgroups: comp.lang.c Subject: Re: C arrays of strings Message-ID: <2309@mandrill.CWRU.Edu> Date: Wed, 18-Nov-87 21:08:53 EST Article-I.D.: mandrill.2309 Posted: Wed Nov 18 21:08:53 1987 Date-Received: Sat, 21-Nov-87 07:41:49 EST References: <3157@rosevax.Rosemount.COM> Reply-To: chet@mandrill.CWRU.Edu (Chet Ramey) Organization: CWRU Dept. of Computer Engineering, Cleveland OH Lines: 31 Keywords: C In the referenced article richw@rosevax.Rosemount.COM (Rich Wagenknecht) writes: >Could someone explain the following declaration in english and >give an example of how to use it? I believe I can use this declaration >but cannot explain how is works. What I'm after is simply an array of >character strings. > > char *str[12]; Script started on Wed Nov 18 20:55:31 1987 chet%cdecl explain char *str[12] declare str as array 12 of pointer to char script done on Wed Nov 18 20:56:16 1987 That will do the job, if what you want is an array of character strings. In a mailer I wrote (truly a small thing, but you have to start somewhere), I used just such a structure to keep around the resolved addresses, after I plucked the unresolved ones out of argv. I also used them to point into a large, statically-allocated array of chars (keep all the addresses in this long array, and keep pointers to them -- you get the idea). Chet Ramey chet@mandrill.CWRU.Edu {cbosgd,decvax,sun}!mandrill!chet I think that all right-thinking people in this country are sick and tired of being told that ordinary decent people are fed up in this country with being sick and tired. I'm certainly not. But I'm sick and tired of being told that I am. Monty Python