--- In [email protected], "Saurabh Jain" <[EMAIL PROTECTED]> wrote: > > --- In [email protected], "nimak247" <nimak247@> wrote: > > > My program crashes at the point shown below. This message was a bit > > different, though. It said the failure was at xstring, line 137? > > > > I don't know what caused it. How does one debug one of these > > types of > > messages?? > > Try printing out str to see that it contains exactly what it is > supposed to contain. And probably you can also check the value of each > element that iterator iterates over in the loop below. > > > > vector<string> ret; > > iter pos = str.begin(), e = pos; > > > > for(int x = 0; e != str.end() && x != 10; x++){ > > ++e; > > } > > > > ret.push_back(string(pos, e)); /*--program fails here--*/ > > > If you can make a small test case and post it on the group then > probably more people can help you out. > > Regards, > Saurabh >
Hi Saurabh, Sorry it took me a couple days to get back - been busy (work). I was tinkering with the code and I actually got it to work!! Thanks for the assist!! Still, I don't understand what 'Asserts' are?? It is tied to an expression, I get that, but I guess I am wondering what they are used for? Why would you use an assert instead of a try/catch??? any thoughts? Nim
