Problem when using array of qstring or vectors of qstring
-
Hey guys , I had this problem and I couldn't fix it here's the code:
@
QString *array_of_Grades; // in headerarray_of_Grades=new QString[9] {"A+,A,B+,B,C+,C,D+,D,F"}; // in imp
@
it gives me these errors!
@
error: C2143: syntax error : missing ';' before '{'
error: C2143: syntax error : missing ';' before '}'@
-
QStringList array_of_Grades;
array_of_Grades << "A+" << "A" << "B+" << "B" << ... -
I agree with wlinaz. It's always far best (cleaner, safer, etc.) to use the provided container classes rather than relying on manual C-style arrays or pointer handling.