char * libvartmpvar;
char *tempvar;
size_t requiredSize;
getenv_s( &requiredSize, NULL, 0, "LIBTMP");
libvar = malloc(requiredSize * sizeof(char));
if (!libvar) {
/* handle error condition */
}
// Get the value of the LIB environment variable.getenv_s(&requiredSize, tmpvar, requiredSize, "TMP" );
getenv_s(&requiredSize, NULL, 0, "TEMP");
libvar = malloc(requiredSize * sizeof(char));
if (!libvar) {
/* handle error condition */
}
getenv_s( &requiredSize, libvartempvar, requiredSize, "LIB" );
"TEMP" );
if (strcmp(tmpvar, tempvar) == 0) {
puts("TMP and TEMP are the same.\n");
}
else {
puts("TMP and TEMP are NOT the same.\n");
}
|