S60 5th Edition SDK v0.9 Example Applications
Guide |
STL Example
1.
About this Example
2.
Description
3.
Prerequisites
4.
Results
Simple example of storing STL strings in a vector.
This example shows three methods of accessing the data within the vector.
Elements are added in a vector wih the help of push_back() function
and they are accessed in three different methods and each method prints data stored in vector , first loop by index, second
using constant iterators , and third using reverse iterators. later it prints size of the vector using size() function and it
also swaps two elements of vector using swap() function and print the swaped values. A constant iterator is one that can be
used for access only, and cannot be used for modification. Reverse_iterator is an iterator adaptor that enables backwards
traversal of a range .
This examples requires
a basic understanding of the Symbian framework and Carbide C++.Also on hardware sis available in plugin needs to be installed.
OUTPUT:
Loop by index:
The number is 10
The number is 20
The number is 30
Constant Iterator:
The number is 10
The number is 20
The number is 30
Reverse Iterator:
The number is 30
The number is 20
The number is 10
Sample Output:
size of vector = 3
The number is 30
The number is 10
© Nokia 2008 |

|