#include <QVector>
#include <QDebug>
int main()
{
const int n = 10;
QVector<int> vector(n);
int * data = vector.data();
for (int i = 0; i < n; ++i)
data[i] = i;
for (int i = 0; i < n; ++i) {
data[i] * = 2;
qDebug() << vector.at(i);
}
QVector<QString> strvector;
strvector.append("s");
if (strvector[0] == "s")
strvector[0] = "868686876";
qDebug() << strvector;
return 0;
}
|