pointer->pointer problem

kevin reilly reilly at bnlux1.bnl.gov
Thu Apr 4 03:40:58 AEST 1991


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?
*/

}

reilly at bnlux1.bnl.gov




More information about the Comp.lang.c mailing list