Hi there,
in terms of memory is this:
just as valid as this? (using same function above):Code:... my_function("this is static"); ... my_function(char *string) { //do some stuff but don't free; ... }
Code:... char *my_string; my_string = malloc(sizeof(char) * 20); strcpy(my_string,"this is not static"); my_function(my_string); if(my_string != NULL){free my_string;}