This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problems using vector in gcc3.2


Hi,

>    const  int * beg = v.begin();

If you want the pointer you can get it the following way:

const int* beg = &(*(v.begin()));

> xx.cpp: In function `int main()':
> xx.cpp:8: cannot convert
> `__gnu_cxx::__normal_iterator<int*, std::vector<int,
>    std::allocator<int> > >' to `const int*' in
> initialization
> 

Note that the error message is saying to you:

 I cannot convert at compile time from vector<int>::iterator
to const int*. 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]