when i create a thread, i want to pass several arguments. So i define in a header file the following:
struct data{
char *palabra;
char *directorio;
FI
Do not use option #2. The data
structure could be overwritten (explicitly, for instance using the same structure to start another thread, or implicitly, for instance having it overwritten on the stack). Use option #1.
To get at your data, at the start of your thread, do
struct data *info = (struct data*)arguments;
Then access info
as normal. Make sure to free
it when the thread is done (or, as I prefer, have the caller free it after joining with the thread).