For future readers and reinforcemnet of my own long term memory this program crashed because it returned 0 on line 9 when infact it should return a string.
*function. Is my thinking correct. It was called like this assert (c.select(5).length() == 0); // test of error handling
if it was called differently would the program still crash with return 0? How do i exit the function without returning anything but continuing my main() function? Is it due to the fact that assert was used with the condition it crashed?
what is the correct term for a term in brackets i.e if (x==y)? cos im using condition but is obvs wrong...
Returning zero (= NULL) when your return type is std::string triggers the std::string(const char*) version of the constructor, and std::string doesn't like being fed NULL pointers :-(
You can return""; as well as resturn std::string();