You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
535 B
26 lines
535 B
2 years ago
|
#include <iostream>
|
||
|
#include "string/String.h"
|
||
|
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
String s1("Help!"),s2("Good!"),s3(s2),s4,s5;
|
||
|
cout<<"s1="<<s1<<endl;
|
||
|
s3="Hello!";
|
||
|
cout<<"s3="<<s3<<endl;
|
||
|
s3=s2;
|
||
|
cout<<"s3="<<s3<<endl;
|
||
|
s3+=s2;
|
||
|
cout<<"s3="<<s3<<endl;
|
||
|
cin>>s4;
|
||
|
cout<<"s4="<<s4<<endl;
|
||
|
cout<<"s4length="<<s4.Length()<<endl;
|
||
|
|
||
|
/*s5=s3+s4;
|
||
|
cout<<"s5="<<s5<<endl;
|
||
|
s5[0]='g';
|
||
|
cout<<"s5="<<s5<<endl;
|
||
|
cout<<"strlen(s5)="<<s5.Length()<<endl;*/
|
||
|
cout<<boolalpha<<(s3 == s1)<<endl;
|
||
|
}
|