Category C programming Tutorials

Program to copy the contents of one string to another string using a pointer

A C program to copy the contents of one string to another using a pointer method is:     #include #include #include #define length 50   void main() { char *s1,*s2,c; int i=0; clrscr(); s1=(char*)malloc(length*sizeof(char)); s2=(char*)malloc(length*sizeof(char)); printf(“enter stringn”); gets(s1); while((c=*(s1+i))!=”)…

x