View Single Post
Old 24th November 2011
Daffy Daffy is offline
Fdisk Soldier
 
Join Date: Jun 2010
Posts: 73
Default

Ocicat, I cannot thank you enough for your help. I understand fully what you said about the structures and also thanks for the clarification or the function.

Quote:
Originally Posted by ocicat View Post
This is unclear. Please clarify.
When I enter a name (for example in 'artist') and it has 40 characters, taglist.artist stores it properly (with malloc() ). The problem is when I pass the value in char *command[LEN], it stores only the 30 first characters. Do I need to use malloc() on every array object? And if yes, how can I approach this properly? I couldn't find any source about this...

And a last question for free(). When I use it on a char object inside a structure, I target it by name (for this example free(artist)) or by first referring to the structure name (free(taglist.artist))? Is it a good solution to free after use the entire structure by free(taglist)?

I hope I'm making some sense...
Reply With Quote