#include <iostream>
#include<cstring>
#include <algorithm>

using namespace std;
class String
{
    private:
    char *sptr;

    public:
    String() : sptr(nullptr) {}

    String(char str[])
    {
      sptr = new char[strlen(str) + 1];
      strcpy( sptr, str );
    }

    String(const String& source)
    {
        sptr = new char[strlen(source.sptr) + 1];
        strcpy( sptr, source.sptr);
    }

    ~String()
    {
      delete [] sptr; 
    }

    String& operator=( const String& other )
    {
        if(this != &other)
        {
            String tmp( other );   
            std::swap(tmp.sptr, sptr);
        }
        return *this;    
    }
    void display()
    {

      for( char const* p = sptr; *p != '\0'; ++ p) {
            std::cout << *p;
        }
        cout<<endl;

    }


};

 int main()
 {
 	String s1;
 } 	