hi,
What exactly happens in this program
insertaccording to me *s1++ = *s2++ will increment the pointer not the value pointed by it and then it stores the s2++ address inn to it.Code:void main() { char str1[]="Italy"; char str2[2]="Rome"; char *s1=str1,*s2=str2; while(*s1++ = *s2++); printf("%s",str1); }
But i dont know how the while loop is ending...it is supposed to be an infinite loop since we are assigning s1 and s2 and not comparing any condition ????
I am confused how the str1 points to rome at the end printf statement
Please explain me what really happens at the back ???
Regards,
Ram