⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 argenv.c

📁 CC386 is a general-purpose 32-bit C compiler. It is not an optimizing compiler but given that the co
💻 C
字号:
/*
 * this example displays the command line arguments and the environment
 * The 'wildargs' object file is included in the build for this file,
 * which will expand wild card file names
 *
 */
#include <stdio.h>

/*
 * note that the environment list as an argument to main() 
 * is an extension to C, it is *not* something standard but is 
 * generally present in MSDOS C compilers.
 *
 * for portablity, use the 'getenv()' function to get environment variable
 * values
 */
 extern char * _osenv,*_environ ;
int main(int argc, char *argv[], char *env[])
{
  int i;
  char **ptr;

  printf("Argument list: %d\n",argc);
  for (i=0; i < argc; i++)
    printf("\t%d: \042%s\042\n",i,argv[i]);

  ptr = env;
  i = 0;
  printf("Environment:\n") ;
  while (*ptr)
    printf("\t%d: \042%s\042\n",i++,*ptr++);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -