Hi!
I would like to know how can i use "->" with index oprator "[]"
1 2 3 4 5
void Historic::showRanking(QTableWidget *table, QList<Number> *bols)
{
//...code here
bols[ i ]->val //Herror here. I have to use "at( i ).val" to work. Why?
}
-> is for use with pointers to objects while . is for use with objects. If you can use 'at(i).val' then I'm guessing you are addressing an object not a pointer to an object.
Edit: looking more closely, you are using a Number object inside of QList bols. If it were 'QList<Number*> *bols' then you would use 'at(i)->val' as the objects inside the list would be pointers.