Write a program for String copy using pointers

#include<stdio.h> #include<conio.h> void strcopy(char  * , char  * ); main() { char s[10], p[10]; printf(“enter a ...

#include<stdio.h>
#include<conio.h>
void strcopy(char *, char *);
main()
{
char s[10], p[10];
printf(“enter a string”);
gets(s);
strcopy(s, p);
puts(p);
getch();
}
void strcopy(char *s, char *p)
          {
            while (*s!=’\0’)
                        {
                        *p=*s;
                        p++, s++;
                        }
                        *p=’\0’;

            }

Related

C Programs 1775155023778312498

Post a Comment

emo-but-icon

item