For example:
Code: Select all
FILE *tempfd;
tempfd = fopen(concat(path, ".temp", NULL), "w");
fclose(tempfd);
I really need to free the allocated memory before returning, because, if I don't do that, then a lot of memory will be wasted each time I call concat().
If somebody creates a function that detects the number of arguments in variable-arity-functions (something like va_num()...), all would be easier.
I have seen strdup()... it uses malloc or something like that? As I readed here, I also need to use free if I call strdup().Codestation wrote:
(take strdup by example)
Well, thank you a lot for your suggestions and quick answers. I'm still thinking at it...
Advertising

