Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



How to replace a C++ array with a wrapper

C++ arrays can always be replaced with a TFixedArray<class T,TInt S>. For example:

TChar iSeparators[EMaxSeparators];
CCoeControl* iControls[ENumControls];

becomes:

TFixedArray<TChar,EMaxSeparators> iSeparators;
TFixedArray<CCoeControl*,ENumControls> iControls;

The contained class must have a default constructor. The array can also be initialised from a C++ array (using a bitwise copy).