Originally Posted By: 3run
I have an empty global string, I copy results of the function (your example) into it, will it create two objects? The one that returned (created) by the function and that global string that I had from the start?

Yes. You have two string objects.

Quote:
Code:
str_cpy ( globalStr, new_string("Hello?") );


This code causes the address of the new string get lost because the return of the 'new_string' is not saved so you will not be able to remove the new string.

I think the better choice is to direcly use the new string instead of copying it to another but it depends on the rest of the code xP

Code:
STRING *strResult = new_string ( "hello" );
...
str_remove ( strResult );



Quote:
And do I really need to delete it in order to save some memory?

Yes. Totalmente. Every object has to be deleted before exiting.

Salud!