QVector
Solved
General and Desktop
-
hello,
QVector <int> a; a << 20 << 30 << 40 << 50;
error message : a does not name a type
why i am getting this error message how can i solve it ? -
It should not. Show your complete program or try with just main.cpp. It should work. Did you #include <QVector>
-
i added #include<QVector>;
-
@veysel.olgun you cannot do this outside a function. try placing your code onside a fuction.
-
hmm. You cannot execute the statement at global declaration. You are trying to execute the function outside. Only variable can be declared globally. Rest you have to do inside the code.
e.g
QVector<int> a; int main(int argc, char *argv[]) { a << 10; }
-
i understand now thank you all, i fixed up the problem with your help
-