Results 1 to 2 of 2

Thread: Python to C++

  1. #1
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Python to C++

    How can I convert.

    Qt Code:
    1. blob = struct.pack("<LLLLLLL", 28, CRYPT_MODE_CBC, CALC_3DES, CALG_SHA1, len(iv), len(hash), len(ciph))
    To copy to clipboard, switch view to plain text mode 

    to C++. I haven't really figured it out.
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Python to C++

    "<LLLLLLL" means seven unsigned long in little-endian order, so it should be:
    Qt Code:
    1. struct something {
    2. unsigned long x;
    3. unsigned long mode;
    4. unsigned long cipher;
    5. ...
    6. };
    7.  
    8. something s;
    9. s.x = qToLittleEndian( (unsigned long)28 );
    10. ...
    To copy to clipboard, switch view to plain text mode 
    or something like that.

Similar Threads

  1. Python or ruby or lua
    By Gopala Krishna in forum General Discussion
    Replies: 6
    Last Post: 13th October 2007, 15:05
  2. Qt, Python and pop-ups
    By bashamehboob in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2007, 19:33
  3. Replies: 7
    Last Post: 15th April 2007, 01:39
  4. QTreeWidgetItemIterator with python
    By rosmarcha in forum Qt Programming
    Replies: 2
    Last Post: 6th September 2006, 17:19

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.