rfind and << crashing program
<p>I have a problem that has a few programmers pulling their hair. The language is C/C++. Consider the code below...assume <em>request</em> is a valid C++ string.</p>

<pre><code>string outMsg;
string trans_str = ("&lt;/TRANSACTION&gt;");
int32_t position;

//Assign outMsg and find "&lt;/TRANSACTION&gt;"
outMsg.assign(request);
position = outMsg.rfind(trans_str);
</code></pre>

<p>The program crashes on the rfind(trans_str). The program also crashes when find(...) and replace(...) is used. It seems it has trouble with most C++ methods. The program also crashes on lines like the following....</p>

<pre><code>cout &lt;&lt; "This is a string " &lt;&lt; variable &lt;&lt; "and this is the end"; //this is an example
</code></pre>

<p>The program usually crashes on the third "&lt;&lt;" and would only print the following output in this example:</p>

<p>"This is a string {variable} " CRASH.</p>

<p>A lot of weird things going on here.</p>

<p>"string" (in angle brackets) is included.</p>

<p>Thank you!</p>
