string copy strcpy 👇

 //this string copy strcpy is used to copy string value from one variable to another variable

// strcpy in costack we first use the target where to copy then source from where to copy


#include <stdio.h>

#include <string.h>


int main()

{ char source[] = "Rohit Parmar";

char target[30] ;

strcpy (target , source);

    printf("source is %s and target is  %s\n " , source , target);


    return 0;

}

*************†******†★*******************


//this string copy strcpy is used to copy string value from one variable to another variable

// strcpy in costack we first use the target where to copy then source from where to copy

// here p work as target

#include <stdio.h>

#include <string.h>


int main()

{ char source[] = "Rohit Parmar";

char  target[30] ;

char *p;

p = strcpy (target , source);

    printf("source is %s and target is  %s  and p is %s" , source , target , p);


    return 0;

}



Comments

Popular posts from this blog

Factors : using C

Cross shaped pattern

Factorial ! calculation