Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Linux C programming, when using getenv function to get environment variables, why is the return value an integer?
Linux C programming, when using getenv function to get environment variables, why is the return value an integer?
Getenv () returns a string pointer. The function prototype is: char * getenv (constchar * name);

Get the value by the name of the environment variable. Of course, plastic printing is a number because it is a pointer. Please try printing with% s.

There is no such name in the environment variable.

Are you sure the warning is correct? This line of code?