home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / hcshdemo.zip / csh-os2.zip / SAMPLES / ARGS.C next >
C/C++ Source or Header  |  1993-09-28  |  752b  |  23 lines

  1. /***************************************************************************/
  2. /*                                                                                                    */
  3. /*                                                                                                    */
  4. /*            Dump the argv[] and envp[] lists passed to the program.                */
  5. /*    Copyright (c) 1989-1992 by Hamilton Laboratories.  All rights reserved.    */
  6. /*                                                                                                    */
  7. /*                                                                                                    */
  8. /***************************************************************************/
  9.         
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12.  
  13. void cdecl main ( int argc, char *argv[], char *envp[] )
  14.         {
  15.         int i;
  16.         printf ("argc = %d\n", argc);
  17.         for (i = 0;  i < argc; i++)
  18.             printf ("argv[%d] = '%s'\n", i, argv[i]);
  19.         for (i = 0;  envp[i]; i++)
  20.             printf ("envp[%d] = '%s'\n", i, envp[i]);
  21.         exit(0);
  22.         }
  23.