T
tfelb
This function creates a puzzle for me which I don't understand.
Through the process of s2, the pointer increments beyond the limit of
the given pointer array in main.
I have another function where I used a pointer array as an argument
and a function parameter as a double pointer and this works!?
s2 must find the NULL after the second element of that pointer array
but it doesn't.
Sorry it's maybe a fool question.
Thanks for any help!
Tom F.
/*
* TEST Function
*/
void test(char *buffer, char *s1, char **s2)
{
while(*s2)
{
s2++; /* Steps beyond into garbage */
}
}
/* in main */
char ja[] = "This";
char jo[] = "That";
char je[] = "Nothing";
char *text[2];
text[0] = ja;
text[1] = jo;
text[2] = je;
join(erg,"<",text);
Through the process of s2, the pointer increments beyond the limit of
the given pointer array in main.
I have another function where I used a pointer array as an argument
and a function parameter as a double pointer and this works!?
s2 must find the NULL after the second element of that pointer array
but it doesn't.
Sorry it's maybe a fool question.
Thanks for any help!
Tom F.
/*
* TEST Function
*/
void test(char *buffer, char *s1, char **s2)
{
while(*s2)
{
s2++; /* Steps beyond into garbage */
}
}
/* in main */
char ja[] = "This";
char jo[] = "That";
char je[] = "Nothing";
char *text[2];
text[0] = ja;
text[1] = jo;
text[2] = je;
join(erg,"<",text);