C++ Program to Copy String to New String

In this program, you'll learn to how to copy given string into new string without using strcpy() function.

Source Code
using namespace std;

int main()
    int i;
    char copy[30], paste[30];

    cout<<"Enter the string to copy: ";

    for(i=0; copy[i] != '\0'; i++)
        paste[i] = copy[i];
    paste[i] = '\0';

    cout<<"Copied string is: ";
    return 0;

Enter the string to copy: Sample String
Copied string is: Sample String