close
Namensräume
Varianten

std::getenv

Aus cppreference.com
 
 
 
Das Programm unterstützt Versorgungsunternehmen
Beendigung des Programms
Original:
Program termination
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
abort
exit
quick_exit(C++11)
_Exit(C++11)
Die Kommunikation mit der Umwelt
Original:
Communicating with the environment
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Signale
Original:
Signals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Signal-Typen
Original:
Signal types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
SIGABRT
SIGFPE
SIGILL
SIGINT
SIGSEGV
SIGTERM
Nicht-lokale Sprünge
Original:
Non-local jumps
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
setjmp
longjmp
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
jmp_buf
 
<tbody> </tbody>
definiert in Header <cstdlib>
const char *getenv( const char *env_var );

Sucht eine Umgebungsvariable mit dem Namen env_var in der Hostspezifischen Umgebungsvariablenliste und gibt die damit verbundene Information zurück. Der Satz an Umgebungsvariablen und Methoden um ihn zu verändern sind von der Implementation festgelegt.

Parameter

env_var - null-terminierte Zeichenkette, die den Namen der zu suchenden Umgebungsvariable darstellt.

Rückgabewert

Zeichenkette mit dem Wert der Umgebungsvariable oder NULL, wenn die Variable nicht gefunden werden konnte.

Beispiel

#include <iostream>
#include <cstdlib>

int main(int argc, char *argv[])
{
    std::cout << "Your PATH is: " << std::getenv("PATH") << std::endl;
}

Possible output:

Your PATH is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

Siehe auch

C documentation for getenv