Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 16:26, 10 September 2007.

How to convert TBuf16 to char(buffer)

From Forum Nokia Wiki

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <wchar.h>
#include <e32base.h>
 
#define SIZE 10
_LIT(KData,"FNWiki");
  
int main (void)
{
    TBuf16<SIZE> buf(KData);
    char CArray[SIZE];
    size_t ret;
   
    ret = wcstombs(CArray, (const wchar_t *)buf.PtrZ(), SIZE );
    printf("TBuf16 converted to a char buffer: %s\n",CArray);
    getchar();
    return (1);
}

Here, bwcstombs API is used to convert TBuf16 buffer to a char buffer.

Links

String Utilities

Related Discussions
Thread Thread Starter Forum Replies Last Post
bitmap store problem selcuktortop General Symbian C++ 1 2004-07-29 03:59
TPtr8 -> TBuf16 hex xdimas General Symbian C++ 1 2003-12-26 11:41
How to Convert TBuf to TInt raghavendra General Symbian C++ 2 2007-02-08 04:15
CArrayVar Problem vickey General Symbian C++ 6 2008-02-11 17:45
how to Compare TBuf8 and HBufC* rapolurakesh General Symbian C++ 8 2007-11-21 14:56
 
Powered by MediaWiki