Set argument pointer to point to new memory inside a function (without returning it) IN C
Posted
by user321605
on Stack Overflow
See other posts from Stack Overflow
or by user321605
Published on 2010-04-20T18:45:03Z
Indexed on
2010/04/20
18:53 UTC
Read the original article
Hit count: 153
Hello,
Hopefully my title was descriptive enough to attract the right help.
I want to write a function that will return 1 thing, and modify a provided pointer in another.
My current function declaration is . . .
char * afterURL replaceURLS(char * body)
What I want to do is copy all of body's data into a new string, and set body to point to this new data. I then want afterURL to point to a location within the new string.
My issue is getting the actual pointer that is passed in to this function to point to the new data.
Thanks in advance! Rob
© Stack Overflow or respective owner