File:  [MW Coherent from dump] / coherent / a / usr / man / ALL / argv
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:34 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent



argv                        C Language                       argv




Argument passed to main()

char *argv[];

argv  is an  abbreviation  for ``argument  vector''.   It is  the
traditional name  for a  pointer to  an array of  string pointers
passed to  a C program's main function; by  convention, it is the
second argument  passed to  main.  By convention,  argv[0] always
points to the name of the command itself.

***** Example *****

This example  demonstrates both argc and  argv[], to recreate the
command echo.


main(argc, argv)
int argc; char *argv[];
{
        int i;



        for (i = 1; i < argc; ) {
                printf("%s", argv[i]);
                if (++i < argc)
                        putchar(' ');
        }



        putchar('\n');
        return 0;
}


***** See Also *****

argc, C language, envp, main()

















COHERENT Lexicon                                           Page 1



unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.