Mobiiliohjelmointi/Mobile
programming
Exercise 2 – Memory management
This
exercise focuses on how to handle memory, especially, how to allocate objects
using the Two phase construction idiom. It also shows how to use T -type struct classes.
Resources
Download
this
application memConsole (zip file) that is used as
a basis for the exercise.
Import the project..
Put the project zip into same drive as your symbian environment
(usually c:, you can not use any directory under desktop, because
"documents and settings" has spaces), unzip and press import from carbide. Select Symbian OS-> Symbian bld.inf. Click next. Browse for bld.inf -file
of your project. Next. Symbian OS SDK, select right SDK. Next. Select
mmp-files, this time there is only file memconsole.mmp. Next. Project
name and the root directory should be ok. Press Finish.
The
project has 2-3 classes. These are CRecordStore, TScore and memconsole. TScore stores two
values, the name of a person and a numerical mark. CRecordStore
saves these TScore records in an array. Memconsole is responsible for
1.
Initializing the TScore values,
2.
Creating the CRecordstore,
3.
Adding the TScore objects to CRecordStore.
:
Students Task :