tags: C language
File Name: get_env.c
Compile instruction: gcc -std = c99 get_env.c -o get_env.out
#include <stdlib.h>
#include <stdio.h>
static inline int readenv_atoi(char *env) {
char *p;
// GetENV function is a function of GCC comes with the STDLIB.H header file.
if (( p = getenv(env) ))
return (atoi(p));
else
return(0);
}
int main(int argc, char** argv)
{
int numprocs = readenv_atoi("OMP_NUM_THREADS");
printf("numprocs = %d\n",numprocs);
return 0;
}

Code Source: Source Code of OpenBlas
1, code ...
Linux execution Python Gets the way system environment variables. ...
In the Windows operating system, we can get system language through getSystemDefaultLangID, but maybe you don't know: What setting to modify the system will affect the return value of GetSystemDefault...
A, Java environment variables Java Environment variables very simple way: System.getEnv()Get all the environmental variables System.getEnv(key) Get an environment variable Second, the acquisition syst...
First understand a concept; in addition to the environment variables can be viewed from the system properties-environment variables; there is also a copy in the registry; The user's environment variab...
problem How do I get system environment variables and variables in the Application configuration file? solve Use EnvironmentaWare. Implement the interface environmentaWare and override the method Sten...
<script type="text/javascript"> $(function () { $('pre.prettyprint code').each(function () { var lines = $(this).text().split('\n').length; var $numbering = $('<ul/>').addClass('...