Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!jarthur!uunet!rushpc!jjr From: jjr@rushpc (John J. Rushford Jr) Newsgroups: comp.lang.c Subject: Novice question on vectors of pointers Message-ID: <1991Apr29.051313.2064@rushpc> Date: 29 Apr 91 05:13:13 GMT Organization: My place on the Front Range Lines: 43 I hope this question is not too OS specific. Point me elsewhere if it is. How does one use a vector of pointers to member names. I'm specifically trying to use getgrnam(3C) in UNIX SVR3.2 and I want to print to 'stdout' all the entries in **gr_mem. Below is an example of what I'm trying to work with. I don't have any problem with the remaining elements in the structure. It's **gr_mem I don't understand. How do you work with it? EXAMPLE: #include /* From '/usr/include/grp.h' struct group { char *gr_name; /* the name of the group */ char *gr_passwd; /* the encrypted group password */ int gr_gid; /* the numerical group ID */ char **gr_mem; /* vector of pointer to member names */ }; struct group *pntr, *getgrnam(); main() { pntr = getgrnam("other"); fprintf(stdout, "%s\n", pntr->gr_name); fprintf(stdout, "%s\n", pntr->gr_passwd); fprintf(stdout, "%d\n", pntr->gr_gid); return 0; } thanks a ton. -- John ---- Westminster Colorado