Solved programming problem

String copy with string.h in C.

Source code

#include <stdio.h>

#include<string.h>

int main()

{

    char str1[100],str2[100];

    printf("Please Enter Massage: ");

    gets(str1);

     strcpy(str2,str1); /// string Copy function

    printf("
Your Massage is: %s
",str2);

    return 0;

}

Output

Please Enter Massage: code to haven

Your Massage is: code to haven

Join the discussion

Add your comment