Results 1 to 7 of 7

Thread: Binary file reading using Structure

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    107
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    36
    Thanked 2 Times in 2 Posts

    Default Re: Binary file reading using Structure

    Quote Originally Posted by MrDeath View Post
    you have to overload operator<<() and operator>>() for your struct
    MrDeath,

    I'm also interested in knowing how this overloading works as I've tried it without success...
    TIA,
    Pedro.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: Binary file reading using Structure

    Take any book for c++, there will be a lot of examples how to overload a operator. For debug and struct use
    Qt Code:
    1. friend QDebug operator<<(QDebug out, const YourStruct &s)
    2. {
    3. //...
    4. }
    To copy to clipboard, switch view to plain text mode 
    The text stream works equal. And the place for the deklaration/definition you will find...

  3. The following 2 users say thank you to Lykurg for this useful post:

    pdoria (25th July 2009), umulingu (27th July 2009)

Similar Threads

  1. Reading characters in Binary file.....
    By umulingu in forum Qt Programming
    Replies: 2
    Last Post: 23rd July 2009, 04:51
  2. Binary file Reading.........
    By umulingu in forum Qt Programming
    Replies: 11
    Last Post: 20th July 2009, 06:18
  3. reading 4-bytes integer from binary file
    By maka in forum Qt Programming
    Replies: 8
    Last Post: 12th May 2009, 05:57
  4. Read binary from file
    By weldpua2008 in forum Newbie
    Replies: 2
    Last Post: 3rd April 2009, 23:50
  5. Reading binary data
    By vermarajeev in forum Qt Programming
    Replies: 1
    Last Post: 13th August 2007, 09:14

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
  •  
Qt is a trademark of The Qt Company.