§ 条目简介 函数名: getenv 功 能: 从环境中取字符串 用 法: char *getenv(char *envvar); § 列举例子 程序例: #include <stdlib.h> #include <stdio.h> int main(void) { char *s; s=getenv("COMSPEC"); /* get the comspec environment parameter */ printf("Command processor: %s\",s); /* display comspec parameter */ return 0; } |