String copy

Description:

Write a program to find length of string by overloading = operator Test Case 1 Input (stdin) happy Expected Output Copied string is happy Test Case 2 Input (stdin) H:)appy Expected Output Copied string is H:)appy

Program :

#include <iostream>

#include<cstring>

using namespace std;

 int main()

{

char str1[100]=" ";

 char str2[100];

 cin>>str1 >>str2;

strcpy(str2,str1);

cout<< "Copied string is "<<str2;

return 0;

 }