>>>execv( argv[1], argv + sizeof( argv[1] ) );
>> Could you explain this? Why would this line be *more* correct than the
precedent?
> The second version makes the pointer arithmetic explicit and has the
> correct type for the second argument. The first involves an implicit
> cast from char*
> correct, the call should be:
>execv( argv[1], argv[2] );
> For the fanatically correct, this might be better:
>execv( argv[1], argv + sizeof( argv[1] ) );
Could you explain this? Why would this line be *more* correct than the
precedent?
Moreover, argv + sizeof (argv[1]) is equ
2 matches
Mail list logo