#includevoid Example() { const TText* text = L"Hello, world!"; TPtrC ptr(text); TInt length = ptr.Length(); // length is now 13 }
#includeThis code creates two TPtrC objects from constant strings and then uses the Compare function to compare them. Package library: e32std.libvoid Example() { const TText* name1 = L"John"; const TText* name2 = L"Mary"; TPtrC ptr1(name1); TPtrC ptr2(name2); TInt result = ptr1.Compare(ptr2); // result is now -1 because "J" comes before "M" in the alphabet }