code-experiments/examples/bbob2009-c-cmaes/coco.c
/**
 * @brief Returns a concatenate copy of string1 + string2.
 *
 * The caller is responsible for freeing the allocated memory using coco_free_memory().
 */
@brief Returns a concatenate copy of string1 + string2.
The caller is responsible for freeing the allocated memory using coco_free_memory().
@brief Returns a concatenate copy of string1 + string2 . The caller is responsible for freeing the allocated memory using coco_free_memory () .
static char *coco_strconcat(const char *s1, const char *s2) {
  size_t len1 = strlen(s1);
  size_t len2 = strlen(s2);
  char *s = (char *) coco_allocate_memory(len1 + len2 + 1);
  memcpy(s, s1, len1);
  memcpy(&s[len1], s2, len2 + 1);
  return s;
}
static char * coco_strconcat ( const char * s1 , const char * s2 ) { size_t len1 = strlen ( s1 ) ; size_t len2 = strlen ( s2 ) ; char * s = ( char * ) coco_allocate_memory ( len1 + len2 + 1 ) ; memcpy ( s , s1 , len1 ) ; memcpy ( & s [ len1 ] , s2 , len2 + 1 ) ; return s ; }
@brief Returns a concatenate copy of string1 + string2.
@brief Returns a concatenate copy of string1 + string2 .