Search found 3 matches

by mbkt
Sat Mar 05, 2005 7:26 pm
Forum: C++
Topic: vector->at(i) ?
Replies: 4
Views: 3422

It works! Thanks a lot! :)
by mbkt
Sat Mar 05, 2005 1:11 pm
Forum: C++
Topic: vector->at(i) ?
Replies: 4
Views: 3422

Yes, i understand it, i also tried using operator [] but it's a vector<>*, so i cannot call operator [], then i get CE too:
class vector<int,allocator<int> >' used where a `int' was expected
There's some way i can use that operator in a pointer type?
(Sorry, but i'm quite new in C++...)

Thanks ...
by mbkt
Sat Mar 05, 2005 12:15 pm
Forum: C++
Topic: vector->at(i) ?
Replies: 4
Views: 3422

vector->at(i) ?

Hi, I have submited a solution which uses the function vector::at(int) and i got CE...

What am i doing wrong? this simple code causes a Compile Error:
#include <vector>

int main(){
vector<int>* vc = new vector<int>();
return vc->at(0);
}

no matching function for call to `vector<int,allocator ...

Go to advanced search