M
michael
Hi All,
I am trying to create an array the same as the char *argv[] that is passed
to main() ie main(int argc, char *argv[])
I need to store a pointer to and integer in one of the elemets, but the
compiler complains when I try to do this.
a_defined_structure *shared_mem;
char *args[2];
shared_mem = malloc(sizeof (a_defined_structure));
args[0] = argv[1]; //fname
args[1] = shared_mem; // handle
what is the correct method of doing this? I need the two arguments in one
array so I can pass it to execv()
Thanks for your help
Regards
Mike
I am trying to create an array the same as the char *argv[] that is passed
to main() ie main(int argc, char *argv[])
I need to store a pointer to and integer in one of the elemets, but the
compiler complains when I try to do this.
a_defined_structure *shared_mem;
char *args[2];
shared_mem = malloc(sizeof (a_defined_structure));
args[0] = argv[1]; //fname
args[1] = shared_mem; // handle
what is the correct method of doing this? I need the two arguments in one
array so I can pass it to execv()
Thanks for your help
Regards
Mike