down

John L. Furlani furlani at broadway.UUCP
Wed Dec 14 11:26:12 AEST 1988


In article <2803 at hound.UUCP>, rkl1 at hound.UUCP (K.LAUX) writes:
> In article <45370 at yale-celray.yale.UUCP>, wald-david at CS.YALE.EDU (david wald) writes:
> > 
> > You can't assign to a ++ expression.
> > 
> 
> 	Of course you can!  For example, a simple string copy function:
> 
> copy_string (from, to)
> char *from;
> char *to;
> {
> 	while (*to++ = *from++)
> 		;
> }
> 

Take another look.
You aren't assigning anything to the ++ expression.
Oops.
You are assigning something to what is contained in the pointers. 
The *pointers* are being incremented.
David Wald was correct, you can't assign to a ++ expression.
Try it and watch what happens.


____________
Disclaimer:  "If anyone else was responsible,
                       it had to have been me, and myself"
John L. Furlani 
The University of South Carolina, Columbia SC
(...!uunet!ncrlnk!ncrcae!broadway!furlani)



More information about the Comp.lang.c mailing list