Read-only archive of the All About Symbian forum (2001–2013) · About this archive

writing a byte to TBuf8<1024>

2 replies · 2,329 views · Started 28 May 2005

Hi, All 8))

There's a member of my class

TBuf8<1024> iBuf;

when I try to perfom in function of this class such code:

TUint8 aCommand;
iBuf[0] = aCommand;

application crashes with message "closed USER 21"

How should I properly change elements of TBuf8 ?)

Thanks for helping 8)

Hi,
Assignment operator for Tbuf takes only either a descriptor or a pointer to a string
and so direct assignment is sure to crash.
first convert the TInt to a TDes and then try assigning it .
Bye.
--eminemence.

I've got an easier way 8))

iBuf.Copy(" "😉;
iBuf[0] = aCommand;

It works well 8))

Thanks for helping 8)