×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    1

    Question About the overload of operator= () at Descriptor TBuf8

    Hello everyone and this is a problem confused me

    I just see the operator overload defined in .h file as follows:

    inline TBuf8<S>& operator=(const TUint8* aString);

    so I try to write code like this:

    TBuf8<20> buf;
    char* data = "Hello";
    buf = data;

    and the IDE says there are errors; I don't know why...

    how can I correctly understand this operator overload?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,697

    Re: About the overload of operator= () at Descriptor TBuf8

    char and TUint8 are different types, you have to cast
    Code:
    buf = reinterpret_cast<TUint8*>(data);
    should work better.

Similar Threads

  1. can i overload operator new and delete
    By dt10000 in forum Symbian
    Replies: 5
    Last Post: 2009-09-16, 19:53
  2. Replies: 14
    Last Post: 2009-05-16, 14:39
  3. How to write MAC-address to TBuf8 descriptor?
    By jpgustaf in forum Symbian
    Replies: 2
    Last Post: 2009-03-24, 11:04
  4. how to write 10101010 in TBuf8 descriptor?
    By newbie2201 in forum Symbian
    Replies: 3
    Last Post: 2008-08-29, 09:27
  5. How to store a TInt8 to a TBuf8 descriptor??
    By charisse in forum Symbian
    Replies: 5
    Last Post: 2007-12-10, 05:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×