Results 1 to 4 of 4

Thread: Array of Vectors

  1. #1
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Red face Array of Vectors

    I am trying to create an array of vectors containing float values. The reason I want this is because I have an enumerated type that will always have x-number of data fields but there can be a growing or shrinking number of rows containing each of those x-fields. So since my columns will never gain or lose columns I want to use an array for this static size but since the rows can grow and shrink I want to use a vector for each column so I can add or delete rows. I have googled around and cannot find if it is possible to create an array of vectors. Thanks for your help!

  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: Array of Vectors

    Qt Code:
    1. std::vector<float> vectors[10];
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to jacek for this useful post:

    ToddAtWSU (12th April 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Array of Vectors

    It's that simple? So then all the vectors will be of type float? Thanks!

  5. #4
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Red face Re: Array of Vectors

    How would I go about setting this as a private member of a class in a .h file? Would I just say:

    Qt Code:
    1. vector<float> vectors[]
    To copy to clipboard, switch view to plain text mode 

    Thanks again!

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. Problem in converting QString to QChar array?
    By KaKa in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2007, 00:38
  3. position vectors
    By KaKa in forum Newbie
    Replies: 6
    Last Post: 18th March 2007, 16:06
  4. How to create QPixmap from unsigned character array?
    By rashidbutt in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 18:25
  5. QSettings again ... how to remove array elements
    By Mike in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 08:58

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.