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