TPtrC is a class template in C++ that provides a constant pointer to a character. It is a member of the Symbian platform class library that provides C++ classes for Nokia Symbian OS.
Here are some examples of using TPtrCRight:
Example 1: Using TPtrCRight to read a narrow (ASCII) string
#include // include Symbian platform class library
void readNarrowString(const TPtrC8& str) { // Print string character by character for (int i = 0; i < str.Length(); i++) { printf("%c", str[i]); } printf("\n"); }
int main() { // Create a TPtrCRight to a narrow string literal TPtrC8 myString = _S8("Hello");
// Read the string using our function readNarrowString(myString);
return 0; }
Example 2: Using TPtrCRight to read a wide (Unicode) string
#include // include Symbian platform class library
void readWideString(const TPtrC16& str) { // Print string character by character for (int i = 0; i < str.Length(); i++) { printf("%C", str[i]); } printf("\n"); }
int main() { // Create a TPtrCRight to a wide string literal TPtrC16 myString = _S16("Hello");
// Read the string using our function readWideString(myString);
return 0; }
In both examples, we create a TPtrCRight object that points to a string literal. The TPtrCRight object can be passed to functions that take a TPtrC type, allowing us to read the string data without the risk of accidentally modifying it.
The package library for TPtrCRight is in the Symbian platform class library, which provides C++ classes for Nokia Symbian OS.
C++ (Cpp) TPtrC::Right - 15 examples found. These are the top rated real world C++ (Cpp) examples of TPtrC::Right extracted from open source projects. You can rate examples to help us improve the quality of examples.