苗火 Nicholas
[C]Why function getenv() return a minus value
2016-2-2 萧


In the case include no stdlib.h file, the function getenv() return a minus value.



#include <stdio.h>
#include <stdlib.h>
void main(){
int rc;
char *env = NULL;

env = getenv("LIB");
printf("&env = %d \n", env);
if(env){
printf("config home:%d\n", env);
}

env = getenv("HOME");
printf("&env = %d \n", env);
if(env){
printf("home:%s\n", env);
}

}

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容