Espaços nominais
Variantes
Acções

std::getenv

Da cppreference.com
< cpp‎ | utility‎ | program

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
initializer_list(C++11)
bitset
hash(C++11)
Os operadores relacionais
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares e tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Troque, avançar e avançar
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
Utilitários de apoio do programa
Término do programa
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)
Comunicando com o meio ambiente
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.
getenv
Sinais
Original:
Signals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos de sinais
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
Não-locais saltos
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
Tipos
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
 
Defined in header <cstdlib>
const char *getenv( const char *env_var );
Pesquisas de uma variável ambiental com env_var nome no host especificado lista ambiente e retorna informações associada a ele. O conjunto de variáveis ​​ambientais e métodos de alterá-lo é definida pela implementação.
Original:
Searches for an environmental variable with name env_var in the host-specified environment list and returns information associated with it. The set of environmental variables and methods of altering it are implementation-defined.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar] Parâmetros

env_var -
terminada em nulo cadeia de caracteres que identifica o nome da variável ambiental para procurar
Original:
null-terminated character string identifying the name of the environmental variable to look for
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

Cadeia de caracteres que identifica o valor da variável de ambiente ou NULL se tal variável não for encontrado.
Original:
Character string identifying the value of the environmental variable or NULL if such variable is not found.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Exemplo

#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

[editar] Veja também

C documentation for getenv