当前位置: 技术问答>linux和unix
What's wrong?
来源: 互联网 发布时间:2015-03-31
本文导语: I'm freshman.Thanks! $ vi myenv.c #include int main(void) { char *myenvvar=getenvl("EDITOR"); printf("The editor environment is set to %sn",myenvvar); } $gcc myenv.c -o myenv $export EDITOR | you should locate the pointer of cha...
I'm freshman.Thanks!
$ vi myenv.c
#include
int main(void)
{
char *myenvvar=getenvl("EDITOR");
printf("The editor environment is set to %sn",myenvvar);
}
$gcc myenv.c -o myenv
$export EDITOR
$ vi myenv.c
#include
int main(void)
{
char *myenvvar=getenvl("EDITOR");
printf("The editor environment is set to %sn",myenvvar);
}
$gcc myenv.c -o myenv
$export EDITOR
|
you should locate the pointer of char atual memory first.
try instead this:
...
printf("The editor enviornment is set to %sn",getenv("EDITOR"));
...
NOTE:NOT getenvl
try instead this:
...
printf("The editor enviornment is set to %sn",getenv("EDITOR"));
...
NOTE:NOT getenvl