Hi,
if I write the following function
char *copy_strings(char *s1, char *s2)
{
while(*s1)
{
*s2=*s1;
s2++;
s1++;
}
*s2='\0';
return(s2)
}
where s1 is a char array,say char s1[]="abcdef", and s2 is another empty char array
it does not give an error
But if I use integer arrays instead of character arrays it gives an error
L-VALUE REQUIRED.
Can you please explain why
if I write the following function
char *copy_strings(char *s1, char *s2)
{
while(*s1)
{
*s2=*s1;
s2++;
s1++;
}
*s2='\0';
return(s2)
}
where s1 is a char array,say char s1[]="abcdef", and s2 is another empty char array
it does not give an error
But if I use integer arrays instead of character arrays it gives an error
L-VALUE REQUIRED.
Can you please explain why