FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
October 01, 2005

Managed String Library for C

(Page 5 of 7)

October, 2005: Managed String Library for C

Listing 4

string_m *str1 = NULL;

if (retValue = strcreate_m(&str1, "test")) {
  fprintf(
     stderr, 
    "Error %d from strcreate_m.\n", 
     retValue
  );
}
else {
  // print actual string
  if (retValue = getstr_m(&cstr, str1)) {
    fprintf(
      stderr, 
        "error %d from getstr_m.\n", 
        retValue
    );
  }
  printf("(%s)\n", cstr);
  free(cstr);  // have to free duplicate string
}

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK