Should I free the memory allocated for the char array, the pointer to which is returned by the function char * getenv( char * )? And in which direction - C free()or C + delete []? If not, why?
char * getenv( char * )
free()
delete []
I mean:
char * ptr = getenv( "LS_COLORS" ); cout << ptr << endl; delete [] ptr; //Is this or free() call needed?
Thank.
environ ( char * ), getenv() environ, , undefined.
environ
getenv()
Getenv . , , , . ( , , , , - .)