Results 1 to 6 of 6

Thread: (SOLVED) Members of a class should be allocated on heap or stack?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2009
    Posts
    44
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    29
    Thanked 5 Times in 5 Posts

    Default (SOLVED) Members of a class should be allocated on heap or stack?

    I didn't find a good answer on the net...

    Should i allocate members of a class on heap or stack?

    Qt Code:
    1. class MyClass
    2. {
    3. public:
    4. MyClass();
    5.  
    6. private:
    7. QString *heap;
    8. QString stack;
    9. int i, j, k;
    10. AnotherClass anotherclass; // or *anotherclass?
    11. }
    To copy to clipboard, switch view to plain text mode 

    When should i use heap allocation?
    Last edited by giowck; 28th November 2009 at 22:43.

Similar Threads

  1. Question about class members
    By serenti in forum Qt Programming
    Replies: 5
    Last Post: 11th June 2009, 14:20
  2. 2 questions: QAuthenticator and stack / heap
    By Tito Serenti in forum Qt Programming
    Replies: 3
    Last Post: 3rd March 2009, 06:56
  3. class QHBoxLayout
    By csvivek in forum Installation and Deployment
    Replies: 2
    Last Post: 10th April 2008, 07:57
  4. stack, heap and C#
    By mickey in forum General Programming
    Replies: 8
    Last Post: 20th August 2007, 18:40
  5. Replies: 4
    Last Post: 26th June 2007, 19: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
  •  
Qt is a trademark of The Qt Company.