Filling Data Structures : QList « Qt « C++






Filling Data Structures

  

#include <QList>
#include <QDebug>

int main()
{
  QList<int> values;
  values << 1 << 4 << 7 << 9;
  qFill(values.begin(), values.end(), 0);
  qDebug() << values; // output: ( 0, 0, 0, 0 )
  return 0;
}

   
    
  








Related examples in the same category

1.Add int to QList
2.Append and insert into QList
3.Foreach loop with QList
4.Sorting QList
5.Find next element in a QList with QMutableListIterator
6.QList of QString
7.Delete all elements in a QList
8.Quick sort QList
9.QList of int