Results 1 to 9 of 9

Thread: display pointer memory address

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: display pointer memory address

    Qt Code:
    1. #include <QApplication>
    2. #include <QLabel>
    3.  
    4. int main(int argc, char** argv)
    5. {
    6. QApplication app(argc,argv);
    7.  
    8. QLabel label;
    9.  
    10. int variable = 2;
    11. int* pointer = &variable;
    12.  
    13. QString num=QString::number(variable);
    14. QString p=QString::number(pointer,16);
    15.  
    16. label.setText("number="+num+"pointer="+p);
    17. label.show();
    18.  
    19. return app.exec();
    20.  
    21. }
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to nish for this useful post:

    sparticus_37 (3rd September 2011)

Similar Threads

  1. Memory debugging in windows
    By txandi in forum Qt Programming
    Replies: 3
    Last Post: 20th February 2009, 13:45
  2. How to display My Current System IP Address...???
    By maveric in forum Qt Programming
    Replies: 8
    Last Post: 4th August 2008, 17:22
  3. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22: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.