I tried that and works.The only problem appears when I send s in execl command(The problem appeared when I changed the type to string)
this is the message from the compiler:
cannot pass objects of non-POD type 'struct std::string' through '...'; call will abort at runtime