Online C++ Compiler

#include<stdio.h> main(){ char str[50]; //create an empty string to store another string char *myString = "Program to copy a String"; sprintf(str, "%s", myString); //Use sprintf to copy string from myString to str printf("The String is: %s", str); }