Original Post
Can anyone explain what is happening here? This works: This works: This implodes horribly: Surely you should be able to fiddle with a reference to your heart's content?
__declspec(dllexport) int DoStuff(std::string& strString);
__declspec(dllexport) int DoStuff(std::string& strString)
{
strString.resize(strString.size()+1, 65); //lengthen string by 1
return 0;
}
int main()
{
std::string Test("Hello");
Dostuff(Test);
}
__declspec(dllexport) int DoStuff(std::string& strString);
__declspec(dllexport) int DoStuff(std::string& strString)
{
strString.resize(strString.size()+2, 65); //lengthen string by 2
return 0;
}
int main()
{
std::string Test("Hello");
Dostuff(Test);
}
__declspec(dllexport) int DoStuff(std::string& strString);
__declspec(dllexport) int DoStuff(std::string& strString)
{
strString.resize(strString.size()+3, 65); //lengthen string by 3
return 0;
}
int main()
{
std::string Test("Hello");
Dostuff(Test);
}