Why does this function work if called internally?
<p>If I call this function stringToUpper(str2) in the currencyConverter.cpp itself, its works and return upper case.</p>

<pre><code>void currencyConverter::stringToUpper(string &amp;s)
{
   for(unsigned int l = 0; l &lt; s.length(); l++)
  {
    s[l] = toupper(s[l]);
  }
}
</code></pre>

<p>However I have a file named <code>unitTest.cpp</code>, and it does this:</p>

<pre><code>#include "unitTest.h"
#include "currencyConverter.h"

CPPUNIT_TEST_SUITE_REGISTRATION(unitTest);


unitTest::unitTest() {
}

unitTest::~unitTest() {
}

void unitTest::setUp() {
}

void unitTest::tearDown() {
}

void stringToUpper(string&amp;);
void unitTest::testStringLowerToUpper()
{
string str = "ILOVECPLUSPLUS";
string str2 = "ilovecplusplus";

cout &lt;&lt; "\nChecking if string 1 '" &lt;&lt; str &lt;&lt; "' equals string 2 '" &lt;&lt; str2 &lt;&lt; "'";
CPPUNIT_ASSERT_EQUAL(str,str2);

//this part i will use my stringToUpperFunction to test.
currencyConverter c;
c.stringToUpper(str2);

cout &lt;&lt; str2 &lt;&lt; endl;
}
</code></pre>

<p>When I try to print <code>str2</code>, it remains as <code>ilovecplusplus</code> instead of being capitalized.</p>

<p>Whats wrong with my code or call?</p>
