First of all let me apologize by my english.
I've googled a lot about my problem, but I had not find anything conclusive.
I have the following piece of code:
Expand|Select|Wrap|Line Numbers
- vector < map < int , char * > > bank;
- bank . reserve ( 10 );
- if ( bank [ 0 ] [ 0 ] == "a" ) //Memory access error (Access violation at address #blabla)
So, to test, I included the following line before "if", and the error changes to that line
Expand|Select|Wrap|Line Numbers
- bank [ 0 ] [ 0 ] = "b"; //Same error
Expand|Select|Wrap|Line Numbers
- map < int , char * > data;
- data [ 0 ] = "a";
- bank . push_back ( data );
As I can see, it seems a problem with map allocation.
So, my exactly question is how can I use this type of association ( vector < map < type1 , type2 > > ) without get into Mermory access violation errors? Is there a way to previously initialize that association in a manner that allow me to insert new element just doing
Expand|Select|Wrap|Line Numbers
- bank [ i ] [ j ] = "some"
Please excuse me if this is trivial, but I'm new to STL.
I appreciate any helps.
Thanx in advance.