Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: initialization
Message-ID: <1990Aug1.170117.21763@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <1990Aug1.011654.22068@ccu.umanitoba.ca>
Date: Wed, 1 Aug 90 17:01:17 GMT

In article <1990Aug1.011654.22068@ccu.umanitoba.ca> rpjday@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@zoo.toronto.edu   utzoo!henry
