Hi,
I am fairly new to C coding and have a question regarding the best practice when using functions to manipulate strings. Basically I would like to know should I write a function like:
char *manipulate(char *str)
{
static char outstr[1024];
< Insert function code >
return outstr;
}
or is it better to write:
char *manipulate(char *outstr, char *str)
{
< Insert function code >
return outstr;
}
I was just curious to know if I should be using one method or the other as a best practice from point of view of performance and or style.
Thanks in advance for any feedback.