Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!bcm!shell!shell!rjohnson From: rjohnson@shell.com (Roy Johnson) Newsgroups: comp.lang.c Subject: Re: pointer->pointer problem Message-ID: Date: 5 Apr 91 15:52:01 GMT References: <1991Apr3.174058.13536@bnlux1.bnl.gov> Sender: usenet@shell.shell.com (USENET News System) Distribution: na Organization: Shell Development Company, Bellaire Research Center, Houston, TX Lines: 24 In-Reply-To: reilly@bnlux1.bnl.gov's message of Wed, 3 Apr 1991 17:40:58 GM In article <1991Apr3.174058.13536@bnlux1.bnl.gov> reilly@bnlux1.bnl.gov (kevin reilly) writes: >char **FUNC1(...) >{ >static char *lines[10]; >/* do stuff */ >return &lines[0]; >} I just realized that lines is static, so it *should* all be initialized to zero (NULL) pointers; give us more information on what you are doing with lines. If you are assigning it like lines[4]=another_string; then any changes you make to lines[4] will of course change another_string, and what you would probably want to do is allocate space for lines[4] (as in my last response) and strcpy(lines[4], another_string); -- ======= !{sun,psuvax1,bcm,rice,decwrl,cs.utexas.edu}!shell!rjohnson ======= Feel free to correct me, but don't preface your correction with "BZZT!" Roy Johnson, Shell Development Company