Clone strings

A simple program that will take an input and define a string, it will then clone it to another string.

#include <iostream>
#include <string>

using namespace std;

int main()
{
    string toclone, cloned;

    cout << "Define the first string and this program will clone it to another string: ";
    getline (cin, toclone);

    cloned = toclone;

    cout << "You entered:  = "<< toclone << endl;
    cout << "Now the cloned string is also:  = "<< cloned;

    return 0;
}

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *