...
Code Block |
---|
errno_t retValue; char *cstr; /* pointer to null-terminated byte string */ string_mx *str1 = NULL; retValue = strcreate_m(&str1, "hello, world", 0, NULL); if (retValue != 0) { fprintf(stderr, "Error %d from strcreate_m.\n", retValue); } else { /* retrieve null-terminated byte string and print, print, and free string */ retValue = getstr_m(&cstr, str1); if (retValue != 0) { fprintf(stderr, "error %d from getstr_m.\n", retValue); } printf("(%s)\n", cstr); free(cstr); /* free null-terminated byte string */ cstr = NULL; } |
Wiki Markup |
---|
Note that the calls to {{fprintf()}} and {{printf()}} are C99 \[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] standard functions and not managed string functions. |
...