ошибка в типе данных 'String' and 'System::String'
Добавлено: 16 июн 2014, 15:54
Всем привет.
помогите, выдает ошибку
[BCC32 Error] File1.cpp(40): E2015 Ambiguity between 'String' and 'System::String'
помогите, выдает ошибку
[BCC32 Error] File1.cpp(40): E2015 Ambiguity between 'String' and 'System::String'
Код: Выделить всё
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#pragma argsused
#include <iostream>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
class String
{
private:
char *str;
public:
String();
String(char *s);
String(const String &);
~String();
String& operator-=(const String& op);
void input();
void see();
};
String::String()
{
strcpy(str,"");
}
String::String(char *s)
{
strcpy(str,s);
}
String::String(const String &a)
{
strcpy(str,a.str);
}
String::~String()
{
if(str) delete [] str;
}
String & String: :o perator-=(const String & op)
{
int i;
for(i=0;*(this->str)==op.str[i]&&*(this->str)&&op.str[i];i++){
this->str++;
}
return *this;
}
void String::see()
{
cout<<"new string: "<<str<<endl;
}
void String::input()
{
cout << "Enter String: ";
gets(str);
}
int main()
{
String a,b;
a.input();
b.input();
b-=a;
b.see();
return 0;
}
}
//---------------------------------------------------------------------------