how to use strcpy (string copy) : String Copy « String « C / ANSI-C






how to use strcpy (string copy)

 /*
Practical C Programming, Third Edition
By Steve Oualline
Third Edition August 1997 

ISBN: 1-56592-306-5
Publisher: O'Reilly
*/

#include <string.h>
#include <stdio.h>
char name[30];    /* First name of someone */
int main()
{
    strcpy(name, "Sam");    /* Initialize the name */
    printf("The name is %s\n", name);
    return (0);
}
 

           
       








Related examples in the same category

1.A simple string copy
2. Copy string: how to use strcpy
3. Copy characters from one string to another: how to use strncpy
4.String copy: assign the pointer value
5.Copy a string