How to write a C program to String copy using Pointer in C Programming ?
Solution:
/*String copy using pointers*/
#include <stdio.h>
void stringCopy(char *str1, char *str2);
int main()
{
char a[] = "BUET";
char b[10];
stringCopy(a, b);
puts(b);
return 0;
}
void stringCopy(char *str1, char *str2)
{
while(*str1)
*str2++ = *str1++;
*str2 = '\0';
}