#include#include int main() { QVector vector(5); vector.fill(0); qDebug() << vector; return 0; }
#includeIn this example, a QVector of size 3 is created and initialized with the string "Hello" using the fill() function. Package library: Qt library#include int main() { QVector vector(3); vector.fill("Hello"); qDebug() << vector; return 0; }