puts(pd) does not give any output in the below code. Also, the first puts(ps) does give an output, but the second puts(ps) after "while" does not give any output. Could please somebody explain? Thanks.
Code:
#include <stdio.h>
int main()
{
char source[50]="Alice has apples.";
char destination[60];
char *pd, *ps;
ps=source;
puts(source);
puts(ps);
pd=destination;
while (*ps!='\0')
*pd++=*ps++;
*pd='\0';
puts(ps); //it does not work!!! Why?
puts(source);
puts(pd); //it does not work!!! Why?
puts(destination);
return 0;
}