pointer->pointer problem
Joachim Richter
richter at immd4.informatik.uni-erlangen.de
Fri Apr 5 19:42:43 AEST 1991
In article <1991Apr3.174058.13536 at bnlux1.bnl.gov> reilly at bnlux1.bnl.gov (kevin reilly) writes:
>I have the following problem with a piece of code.
>If someone could please tell me what I am doing wrong I woulde be quite
>grateful!
>
>FUNC1 returns the address of an array of pointers to strings.
>FUNC2 does some string manipulations.
>
>main()
>{
>char **outPt;
>
>outPut = FUNC1(...);
>FUNC2(outPut);
>}
>
>char **FUNC1(...)
>{
>static char *lines[10];
>/* do stuff */
>return &lines[0];
>}
>
>void FUNC2(char **inPut)
>{
>/* If I manipulate the strings pointed to by inPut in this function
> it seems other strings are also effected.
> Why is this?
>*/
>}
Which *other* strings ? This is C, not ModulaOrAnotherWirthLessThing.
Ingo
More information about the Comp.lang.c
mailing list