#includevoid ProcessData(const TDesC& data) { // Code to process the data } int main() { TBuf<50> data = _L("Hello, World!"); ProcessData(data); return 0; }
#includeIn this example, we define a `TPtrC` object called `data` that points to a string literal containing "Hello, World!". This is useful when we need to pass a string to a function that requires a `TDesC` parameter but we don't want to create a `TBuf` object. The package library for TDesC is the Symbian OS API.int main() { TPtrC data(_S("Hello, World!")); return 0; }