...
Code Block |
---|
size_t str_size = calc_size(other_string); if (str_size !=> 0) { char *str_copy = malloc(str_size); if (str_copy == NULL) { /* handle error */ } strcpy(str_copy, other_string); } |
...
Code Block |
---|
size_t str_size = calc_size(other_string); if (str_size !=> 0) { char *str_copy = malloc(str_size); if (str_copy == NULL) { /* handle error */ } strcpy(str_copy, other_string); } |