Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
errno_t retValue; 
char *cstr;  // c style* pointer to null-terminated byte string */
string_m str1 = NULL;  

if (retValue = strcreate_m(&str1, "hello, world", 0, NULL)) { 
  fprintf(stderr, "Error %d from strcreate_m.\n", retValue);
} 
else { // print string * retrieve null-terminated byte string and print */
  if (retValue = getstr_m(&cstr, str1)) {
    fprintf(stderr, "error %d from getstr_m.\n", retValue); 
  } 
  printf("(%s)\n", cstr); 
  free(cstr); //* free null-terminated duplicatebyte string */
} 

Note that the calls to fprtinf() and fprint() string are C99 standard functions and not managed string functions.

...