Código:
string.cpp#ifndef STRING_H
#define STRING_H
#include <iostream>
using namespace std;
class Str
{
char string[100];
public:
Str(char s[] = "\0")
{
strcpy(string, s);
}
~Str() { };
Str operator +(Str);
Str operator =(Str);
void view();
};
#endif
Código:
main.cpp#include "string.h"
#include <iostream>
Str Str::operator +(Str s)
{
Str tmp;
strcpy(tmp.string, string);
strcat(tmp.string, s.string);
return tmp;
}
Str Str::operator =(Str s)
{
strcpy(string, s.string);
return *this;
}
void Str::view()
{
cout << string;
}
Código:
que esta mal??? #include "string.h"
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
Str str1("Hola "), str2("Mundo"), str3;
str3 = str1 + str2;
str3.view();
system("PAUSE");
return 0;
}

