TITLE: cheating on array bounds [ This article adapted from "Cheating on Array Bounds", Andrew Koenig, C++ Report, V7 N4, p. 12 ] Here is a common C trick: struct string { int length; char data [1]; }; string* p2 = ... ... struct string s = malloc (sizeof (struct string) + p2->length - 1); s->length = p2->length; strncpy (s->data, p2->data, p2->length); ... free (s); ... This is a really bad idea in C++. Suppose we had a C++ version of this as struct string { virtual void foo (); int length; char data [1]; }; It is a common implementation technique to implement this struct as if it were declared as struct string { int length; char data [1]; virtual_table *vptr; }; The virtual table pointer would be wiped out by using the above technique. In short, respect array bounds if you code in C++.