class String

{

private:

char *str; //문자열을 지시하는 포인터

int len; //문자열의 길이

static int num_strings; //객체의 수

static const int CINLIM = 80; //cin 입력한계

public:


//생성자와 기타 메서드

String(const char *s); //생성자

String(); //디폴트 생성자

String(const String& st); // 복사생성자

~String();

int length() const { return len; }


//오버로딩 연산자 메서드

String& operator=(const String& st); 

String& operator=(const char* s);

char& operator[](int i);

const char& operator[](int i) const;


//오버로딩 연산자 프렌드

friend bool operator<(const String&st1,const String& st2);

friend bool operator>(const String&st1,const String& st2);

friend bool operator==(const String&st1,const String& st2);

friend String operator+(const String& st1,const String& st2);

friend ostream& operator<<(ostream& os,const String& st);

friend istream& operator>>(istream& is,String& st);

void StringUp(); //대문자를 소문자로

void StringLow(); //소문자를 대문자로

int cntChar(char c); 

//static 함수

static int HowMany();

};


String operator+(const String& st1,const String& st2)

{


return strcat(st1.str,st2.str);

}


int main()

{

String s1("Test the one");

String s2("You can't see me");

String s3 = s1 + s2;

//s3.cntChar('c');

cout<<s1;

cout<<s2;

//cout<<s3;

return 0;

}

지금 문제하나 풀고있는데 왜 안되는지 이해가 잘안갑니다..
String 클래스는 책에서 공부하면서 제가 정의한 String 클래스이고 
두 문자열을 하나로 결합할 수있도록 +연산자를 오버로딩 하라는 문제의 일부인데 확인결과
빨간색부분에서 에러가나는데, 이유를 모르겠습니다.

strcat 를 이용했는데 이 함수는 리턴값으로 덧붙여진 문자열의 주소값을 반환한다는데 그래서 
operator+의 반환값으로 char* 으로도해보고 String 클래스로도 해봤는데 둘다 런타임에러?인가 그게 나네요 실행도중 나는거..

String s3 = s1 + s2;에서 s1 + s2 를 진행할때 operator+가 호출되고
return strcat(...); 에서 strcat의 반환값으로 문자열 주소가 반환되는데 이때 리턴형이 String 클래스니
이에 맞는 생성자가 호출되면서 임시객체가 생성되고 이 임시객체가 s3에 대입되면서 복사생성자가 호출되어서 복사되는
원리..라고 생각했는데 어디가 문제인지 안되네요 

어디가 문제일까요 형님들

*참고로 복사생성자는 이전 소스에서 긁어온거라 문제가 없을겁니다