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
December 01, 2003
Efficient Variable Automatic Buffers

(Page 1 of 6)
Matthew Wilson
In this article, Matthew presents auto_buffer—a simple, platform-independent STLSoft template class that fulfills dynamically sized allocations from encapsulated arrays.
Efficient Variable Automatic Buffers

Listing 1: Variable variants.

static const char   *m1[] = "static";
void func1(size_t index)
{
  char  m2[4097]  = "";
  char  *m3       = (char*)malloc(4097);
  m2[index] = '\0';
  m3[index] = '\0';
  free(m3);
}
1 | 2 | 3 | 4 | 5 | 6 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK