473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

gnucompiler32

i have this
map<string,vector<int>>mv=x.begin();

i'd like to do this
map<string,vector<int>::iterator>itv=..something-i-don't-know-... to
access elements of vector using iterator
but this is impossible.

second,
i've tried this
map<string,vector<int>>mv=x.begin();
vector<int>::iterator it=mv->second->begin();
error is: no base pointer for second

thanks a lot, Keith

Jun 22 '07 #1
2 1186
ke*************@yahoo.com wrote:
i have this
map<string,vector<int>>mv=x.begin();

i'd like to do this
map<string,vector<int>::iterator>itv=..something-i-don't-know-... to
access elements of vector using iterator
but this is impossible.

second,
i've tried this
map<string,vector<int>>mv=x.begin();
vector<int>::iterator it=mv->second->begin();
error is: no base pointer for second

thanks a lot, Keith
Consider reading the FAQ before posting again, especially section 5.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 22 '07 #2
ke*************@yahoo.com wrote:
i have this
map<string,vector<int>>mv=x.begin();
Good morning to you!
i'd like to do this
map<string,vector<int>::iterator>itv=..something-i-don't-know-... to
access elements of vector using iterator
but this is impossible.
It's impossible to help you if you don't provide any info about the
actual problem. You can actually create such a map.
second,
i've tried this
map<string,vector<int>>mv=x.begin();
vector<int>::iterator it=mv->second->begin();
error is: no base pointer for second
the error message is you friend!
"error is: no base pointer for second"
1) look at the line in which there is the error;
2) look at the "second" token
3) why is it looking to a base pointer? because there is mv->second
4) mhy don't find it? because mv is not a pointer
5) infer the solution: mv.second
6) be happy

Regards,

Zeppe

thanks a lot, Keith
Jun 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.