home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / RB3731.ZIP / ENVIRON.C < prev    next >
Text File  |  1992-04-17  |  1KB  |  33 lines

  1. /*******************************************************\
  2.  *  Program name: ENVIRON.C                            *
  3.  *  Created     : 05/05/90                             *
  4.  *  Revised     : 12/13/91                             *
  5.  *  Author      : Bernd Westphal                       *
  6.  *  Purpose     : Get DOS environment size for VDM lab *
  7.  *  Compile     : cl environ.c                         *
  8.  *  or          : icc /O+ environ.c                    *
  9.  *  Input param : none                                 *
  10. \*******************************************************/
  11.  
  12. #include <stdio.h>
  13. #include <string.h>
  14.  
  15. void main( int argc, char *argv[], char *envp[] )
  16. {
  17.    int   charcount = 0;                    /* # of char  */
  18.  
  19.    printf("Current environment settings:\n\n");
  20.    printf("-----------------------------\n");
  21.    while (*envp)
  22.    {
  23.       printf("%s\n", *envp);
  24.       charcount += strlen (*envp) + 1;     /* add 1 for the string terminator */
  25.       *envp++;
  26.    }
  27.    printf("-----------------------------\n");
  28.    printf("\nTotal environment size is %d bytes.\n\n", charcount);
  29.    /* printf("Press Enter to continue ...\n"); */
  30.    getchar();
  31. }
  32.  
  33.