getenv_("") not defined

Linux specific forum
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

getenv_("") not defined

Post by Num3 »

I get an error when i try this:

currentpath.s=getenv_("PWD")

gcc: c: No such file or directory

here's the c example code:

Code: Select all

#include
#include
int main()
{
char my_env[10];
char *return_val=NULL;
printf("Please enter the variable\n");
scanf("%s", my_env);
return_val=getenv(my_env);
if(return_val == NULL)
printf("Error: There is no %s\n", my_env);
else
printf("%s=%s\n", my_env, return_val);
return 0;
} 
freak
PureBasic Team
PureBasic Team
Posts: 5946
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Why not use this one?
viewtopic.php?p=57962#57962

Timo
quidquid Latine dictum sit altum videtur
Post Reply