devxlogo

November 13, 1999

Zero Sized Arrays?

In standard C++, declaring arrays with zero elements is illegal: int n[0]; //illegal However, certain compilers do support arrays of zero size as non-standard extension. In contrast, dynamic allocation of

Avoid Returning Containers by Value

While the overhead of returning an ordinary object by value may be acceptable in most cases, returning a container by value is much more expensive in terms of performance. For