This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: problems using vector in gcc3.2
- From: "Miguel Ramirez" <mramirez at iua dot upf dot es>
- To: "david d" <phrm at pisem dot net>,"gcchelp" <gcc-help at gcc dot gnu dot org>
- Date: Sun, 13 Oct 2002 15:21:03 +0200
- Subject: Re: problems using vector in gcc3.2
- References: <200210131035.g9DAZFKP033121@www6.mailru.com>
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*.