Results 1 to 3 of 3

Thread: invalid conversion from 'const char*' to 'const unsigned char*' [-fpermissive]

  1. #1
    Join Date
    Feb 2016
    Posts
    21
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default invalid conversion from 'const char*' to 'const unsigned char*' [-fpermissive]

    Hi

    Please can anyone help me?
    i got this error.

    Fehler: invalid conversion from 'const char*' to 'const unsigned char*' [-fpermissive]
    transmit(ASIGN_ACOS_AID_DEC, 12);


    i have defined
    #define ASIGN_ACOS_AID_SIG "\x00\xA4\x04\x00\x07\xA0\x00\x00\x01\x18\x45\ x43"

    and
    ^
    transmit needs (const unsigned char *txBuffer, unsigned long txLength)

    how can i call transmit with ASIGN_ACOS_AID_SIG or how i must define ASIGN_ACOS_AID_SIG

    lg Chris

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: invalid conversion from 'const char*' to 'const unsigned char*' [-fpermissive]

    You could cast or use a properly typed constant instead of a pre-processor macro.

    Cheers,
    _

  3. #3
    Join Date
    Feb 2016
    Posts
    21
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: invalid conversion from 'const char*' to 'const unsigned char*' [-fpermissive]

    thx
    i use constants now.

    lg Chris

Similar Threads

  1. Replies: 5
    Last Post: 8th September 2011, 11:38
  2. Cast to const char *
    By brevleq in forum Qt Programming
    Replies: 3
    Last Post: 3rd January 2009, 10:39
  3. char to const char* with atof
    By mickey in forum General Programming
    Replies: 5
    Last Post: 29th February 2008, 05:10
  4. qt_metacast(const char*)
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 3rd September 2007, 08:03
  5. Conversion from unsigned char* to unsigned char
    By santosh.kumar in forum General Programming
    Replies: 1
    Last Post: 6th August 2007, 14:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.