Results 1 to 6 of 6

Thread: Array question

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Posts
    98
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3
    Thanked 9 Times in 9 Posts

    Default Re: Array question

    You define the int myArrayOne[44][3]; in the class header, so in the constructor you don't have to re-define myArrayOne.
    myArrayOne defined in the constructor is a private variable visible only in the constructor. It is different from the one defined in the class as private member.

    try

    Qt Code:
    1. holdingWidget::holdingWidget(QWidget* parent): QWidget(parent)
    2. {
    3. for (int r=0; r < 44; ++r)
    4. for (int c=0; c<3; ++c)
    5. myArrayOne[r][c] = 1;
    6.  
    7.  
    8. }
    To copy to clipboard, switch view to plain text mode 

    EDIT: There was a trivial error
    Last edited by PaceyIV; 17th August 2009 at 18:00.

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

    td (17th August 2009)

Similar Threads

  1. Problems passing an array of pointers to objects to a function
    By Valheru in forum General Programming
    Replies: 16
    Last Post: 30th June 2008, 00:11
  2. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 15:13
  3. Problem in converting QString to QChar array?
    By KaKa in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2007, 00:38
  4. How to create QPixmap from unsigned character array?
    By rashidbutt in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 18:25

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.