[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string???

Felix Kollmann wrote:

>	try
>	{
>	  vector <string> test;

You create a new vector with 0 elements. 

>	  test[0]= "...";

... and access the first one of them with an unchecked access.
vector::operator[] () does *not* automatically grow the vector. For that
you have to use vector::push_back () or so.

>	}

>The library ´bstring´ throws an exception when doing ´test[0]= "..."´.

Are you sure it's an exception or is it some error of the runtime system?
What's the exact message?


Drive A: not responding...Formatting C: instead