initialization

Henry Spencer henry at zoo.toronto.edu
Thu Aug 2 03:01:17 AEST 1990


In article <1990Aug1.011654.22068 at ccu.umanitoba.ca> rpjday at ccu.umanitoba.ca writes:
>{
>	int i = a, j = i + 1 ;
>
>Am I allowed to initialize the integer "j" with the value of 
>another variable initialized in the same line? ...

The scope of the variable `i' starts at the `=' following `i', so it is
a perfectly legal variable for use in initializing `j'.  (There is nothing
illegal about using it in its *own* initialization, in fact, except that
since it has no defined value at the time, the effect is undefined.)
-- 
The 486 is to a modern CPU as a Jules  | Henry Spencer at U of Toronto Zoology
Verne reprint is to a modern SF novel. |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list