
9-35
Pointers
Explanation:
e function memccpy() works similarly as in the previous program. It copies the source
string to the destination string. Both the strings are displayed.
9.40 Write a program to display the string through their pointer.
else
printf(“memcpyfailed\n”);
}
OUTPUT:
EnteraSourceString:Tomorrow
EnteraDestinationString:TodayisSunday
Destinationbeforememcpy:TodayisSunday
Destinationaftermemcpy:TomorrowisSunday
voidmain()
{
char *c,*m;
c=“CentralProcessingUnit”;
m=“MathCo-Procresser”;
clrscr();
printf(“‘c’ispointingthestring‘%s’\n”,c);
printf(“‘m’ispointingthestring‘%s’\n”,m); ...