Don't use an array. Use QVector or QList as Radek said. Both of them don't need initial size.
Don't use an array. Use QVector or QList as Radek said. Both of them don't need initial size.
Thanks Radek and Lesiok.
I changed from array to QList. I got it.
(1) The error: You cannot declare a "plain" array with a variable size
Tne n needed be an initialized const int.Qt Code:
private: int n;To copy to clipboard, switch view to plain text mode
(2) IMO, QVector is better here. QVector is a dynamic array while QList is a linked list. Nevertheless both of them will serve you good.
binary001 (8th March 2015)
QList is not a linked list, but I agree that QVector is more appropriate here since the length is already known at creation time.
Cheers,
_
Bookmarks