another problem with catstr() this time
I have another question in my assignment that I am at a complete loss on. I am having trouble with these strings and modifying them. Please help and explain what and why you are doing if you do help. Here's the question:
"Identify the errors in the following function; write the corrected version:
Code:
char * cpystr (char * strDest, char * strSource)
{ char * p1, p2;
p1 = strSource;
p2 = strDest;
while(p1 = '\0')
{ p2 = p1;
*p1++;
p2++;
}
p2 = '\0';
return (0);
}
When I try to compile it I get errors on lines 4 and 6.