#include <iostream>
#include <string.h>
using namespace std;
class String 
{
    private:
        enum { SZ=80 }; 
        char str[SZ]; 
    public:
        String(){
            strcpy(str, "");
        }
        String (const char s[]){
            strcpy(str,s);
        }
        String operator = (String obj){
            String newObj;
            strcpy(newObj.str,obj.str);
            return newObj;
        }
        void display(){
            cout << str;
        }
};
int main()
{
    String s1("ABC"); 
    String s3;
    s3 = s1;
    s3.display();
return 0;
}
I'm trying to copy one Char string Object to second one using the above code (assignment operator) operator=, Why it's not working? I tried my best but still failed.
 
    