strcpy()

Prototype: char *strcpy(char *dest, char *tocopy);
Header File: string.h (C) or cstring (C++)
Explanation: Strcpy will copy the string pointed to by tocopy into the string pointed to by dest.



//Example copies a string and outputs the copied string
#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    char *a_string=new char[20];
    strcpy(a_string, "Hello, world...");
    cout<<a_string;  
}
Other Functions