This page was last modified 09:46, 8 December 2007.
Basic Data Types
From Forum Nokia Wiki
• TIntX and TUintX (for X = 8, 16 and 32) for 8-, 16- and 32-bit signed and unsigned integers respectively. Unless you have a good reason to do so, such as for size optimization or compatibility, you should use the non-specific TInt or TUint types, which correspond to signed and unsigned 32-bit integers, respectively.
• TInt64. Releases of Symbian OS prior to v8.0 had no built-in ARM
support for 64-bit arithmetic, so the TInt64 class implemented a
64-bit integer as two 32-bit values. On Symbian OS v8.0, TInt64
and TUInt64 are typedef’d to long long and use the available
native 64-bit support.
• TReal32 and TReal64 (and TReal, which equates to TReal64)
for single- and double-precision floating point numbers, equivalent to
float and double respectively.1 Operations on these are likely to
be slower than upon integers so you should try to avoid using them
unless necessary.
• TTextX (for X = 8 or 16), for narrow and wide characters, correspond
to 8-bit and 16-bit unsigned integers, respectively.
• TAny* should be used in preference to void*, effectively replacing
it with a typedef’d ”pointer to anything”. TAny is thus equivalent
to void but, in the context where void means ”nothing”, it is not
necessary to replace the native void type. Thus, a function taking
a void* pointer (to anything) and returning void (nothing) will
typically have a signature as follows on Symbian OS:
void TypicalFunction(TAny* aPointerParameter);
This is the one exception to the rule of replacing a native type
with a Symbian OS typedef; it occurs because void is effectively
compiler-independent when referring to ”nothing”.
• TBool should be used for boolean types. For historical reasons TBool
is equivalent to int and you should use the Symbian OS typedef’d
values of ETrue (=1) and EFalse (=0). Bear in mind that C++ will
interpret any nonzero value as true. For this reason, you should refrain
from making direct comparisons with ETrue.
• Each TBool represents 32 bits, which may be quite wasteful of
memory in classes with a number of flags representing state or settings.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Basic Capabilities | sohilr | General Symbian C++ | 22 | 2007-12-10 07:04 |
| CPU time in emulator? | olfasupcom | General Symbian C++ | 7 | 2007-11-01 16:13 |
| Save an Image into hashtable | enrique_jb | Mobile Java General | 7 | 2003-11-18 22:06 |
| Basic question regarding Wap/Ringtones | nipuna | Digital Rights Management & Content Downloading | 1 | 2003-02-16 20:40 |
| PC Modem - Visual Basic and Nokia 6310i | ictis | PC Suite API and PC Connectivity SDK | 2 | 2003-08-28 21:21 |
