Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class String{
- string s;
- public:
- void getS(){cout<<s;}
- void setS(){cin>>s;}
- String operator=(String a){
- String b;
- b.s=a.s;
- return b;
- }
- };
- int main(){
- String a;a.setS();
- String b;b=a;
- b.getS();//no output
- }
- //why no output?
Add Comment
Please, Sign In to add comment