Hi,
Please check the code segment.
/*************code start ****/
#include <stdio.h>
int func1(char **a_argv){ while (*a_argv!=NULL) printf("\n%s", *a_argv++); return(0); } int main(int argc, char
*argv[]){
func1(&argv[0]); } /*************code end ****/
This func1 function prints all the arguments with
no problem, because main() is probably always
on stack, so it works probably.
Do anyone see any problem, if one passes argv[]
this way ? Will there be portability issues, like
on other UNIX flavors,etc.
Please let me know.
Thanks and Regards
Deepak
|
- Re: Is it perfectly to pass argv[] this way to funct... Deepak Kotian
- Re: Is it perfectly to pass argv[] this way to ... Craig Dickson
- Re: Is it perfectly to pass argv[] this way... Alan Shutko
- Re: Is it perfectly to pass argv[] this way to ... Elizabeth Barham
- Re: Is it perfectly to pass argv[] this way... Craig Dickson
- Re: Is it perfectly to pass argv[] this... Elizabeth Barham
- Re: Is it perfectly to pass argv[] this way to ... Michael van der Kolff
- Re: Is it perfectly to pass argv[] this way to ... Michael van der Kolff
- Re: Is it perfectly to pass argv[] this way... Deepak Kotian