All pastes #18268 Raw Edit

Untitled

public text v1 · immutable
#18268 ·published 2005-07-22 09:22 UTC
rendered paste body
#include <string>

int test(std::string& str1)
{
  std::string str2 = "hello";
  if (str1 == str2) return 2;
  else return 1;
}

std::string& strtest(void)
{
  std::string str1 = "hello";
  return str1;
}

int _tmain()
{
  return test(strtest());
}

On MSVC: The thread 'Win32 Thread' (0x608) has exited with code 1 (0x1).