I should know this but I dont because I'm so rusty in C it almost hurts so I know somebody out there can answer this in like 2 seconds. I have a char* that I'm sending to a function. I want to do work on that char* in the function and I want the changes I make to stick after I leave the function. So for example:
main()
{
char *fred;
manipulatefred(fred);
}
That's pretty much what I have. What I want to know is, what does the manipulatefred function have to look like so that the changes I make to it actually get fred and not to a copy of fred.
What I'm trying to do in my real program is send an empty string (with memory allocated for it obviously) can get back a full string with real data.
Thanks.
main()
{
char *fred;
manipulatefred(fred);
}
That's pretty much what I have. What I want to know is, what does the manipulatefred function have to look like so that the changes I make to it actually get fred and not to a copy of fred.
What I'm trying to do in my real program is send an empty string (with memory allocated for it obviously) can get back a full string with real data.
Thanks.