Path: utzoo!attcan!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: initialization Message-ID: <367@taumet.com> Date: 1 Aug 90 15:43:05 GMT References: <1990Aug1.011654.22068@ccu.umanitoba.ca> Organization: Taumetric Corporation, San Diego Lines: 22 rpjday@ccu.umanitoba.ca writes: |int func(int a) |{ | 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? What if I put |the two definitions on separate lines? According to ANSI C this is fine, and is equivalent in effect to int i = a; int j = i + 1 ; (By "line" above, I assume you meant "declaration".) The end of an initializer is a "sequence point", and must be fully completed before the next initialization (or statement). There may be non-standard compilers which do not follow this rule. -- Steve Clamage, TauMetric Corp, steve@taumet.com