Just a little something that has been bothering me.

Rory Foster rlf at dptspd.sat.datapoint.com
Wed Dec 19 03:02:49 AEST 1990


sven at cs.widener.edu (Sven Heinicke) writes:

>What is quicker?

>	int a = 0,i = 0;

>or

>	int a,i;
>	i = a = 0;

>and why?

>This type of thing has been bothering me for a long time.


Well, I looked at it and (without optimizing) the first case was "quicker".
I was using the UNIX SVR4 C compiler.  If your compiler has an assembly option,
(-S in Johnson's PCC) use it to see for yourself.

When I optimize, my compiler shows no difference.  So there you have it,
it sort of just depends on what you're using at the time.

Regards,

Rory Foster
rlf at dptspd.sat.datapoint.com



More information about the Comp.lang.c mailing list